0


0 vote down star

我在netbeans 6.7.1里写一个web service 的工程,里面用到了log4j的properties, 在build-impl.xml里增加了拷贝到WEB-INF/classes,生成的war里也确实被拷贝到了正确的位置,但是在部署的过程中,glassfish v2.1 似乎只会复制xml和class,很明显,这个properties文件被忽略了,我不知道应该如何设置使GF能够正确的部署

static Logger logger = Logger.getLogger(MyClass.class);

in Constructor: PropertyConfigurator.configure("log4j.properties");

and in functions:

logger.info("..."); logger.error("..."); ...

but, it is error info(actually, I have tried to put it almost every dir that I could realize):

log4j:ERROR Could not read configuration file [log4j.properties]. java.io.FileNotFoundException: log4j.properties (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(FileInputStream.java:106) at java.io.FileInputStream.(FileInputStream.java:66) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:297) at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:315) at com.corp.ors.demo.OrsDemo.main(OrisDemo.java:228) log4j:ERROR Ignoring configuration file [log4j.properties]. log4j:WARN No appenders could be found for logger (com.corp.ors.demo.OrsDemo). log4j:WARN Please initialize the log4j system properly.

工程代码见 http://www.91files.com/?N3F0QGQPWMDGPBRN0QA8

垃圾帖?
提问于2009-09-28 08:39:05
1 1
添加评论




Made with Django.

当前版本: R-0127-20090523

cc-wiki