Howdy,
You need to specify the absolute path or use an environment variable,
such as one set to the server's home.  Your current specification is
relative to the current working directory of the server, which varies
depending on how the server is invoked.

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Yansheng Lin [mailto:[EMAIL PROTECTED]
>Sent: Thursday, December 11, 2003 12:40 PM
>To: [EMAIL PROTECTED]
>Subject: Log output path problem
>
>
>Hi, I want my log output to go to /WEB-INF/logs/ as specified in my
>log4j.properties
>
>-----------------------------------------------------------------------
-
>log4j.rootLogger=debug, stdout, ROOT_APPENDER
>log4j.appender.ROOT_APPENDER=org.apache.log4j.DailyRollingFileAppender
>log4j.appender.ROOT_APPENDER.DatePattern='.'yyyy-MM-dd
>log4j.appender.ROOT_APPENDER.File=WEB-INF/logs/debug.log
>-----------------------------------------------------------------------
-
>
>But I am getting the following error when I run a test program:
>
>-----------------------------------------------------------------------
-
>log4j:ERROR setFile(null,true) call failed.
>java.io.FileNotFoundException: WEB-INF\logs\debug.log (The system
cannot
>find
>the path specified)
>       at java.io.FileOutputStream.openAppend(Native Method)
>       at java.io.FileOutputStream.<init>(FileOutputStream.java:174)
>       at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
>       at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
>       at
>org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
>       at
>org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingF
ileA
>ppend
>er.java:206)
>       at
>org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247
)
>       at
>org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.jav
a:12
>3)
>       at
>org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.jav
a:87
>)
>       at
>org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurato
r.ja
>va:64
>5)
>       at
>org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurato
r.ja
>va:60
>3)
>       at
>org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyCon
figu
>rator
>.java:500)
>       at
>org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.
java
>:406)
>       at
>org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.
java
>:432)
>       at
>org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConve
rter
>.java
>:460)
>       at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
>       at org.apache.log4j.Logger.getLogger(Logger.java:94)
>       at Log4JTest.<clinit>(Log4JTest.java:21)
>log4j:ERROR Either File or DatePattern options are not set for appender
>[ROOT_APPENDER].
> INFO [main] (Log4JTest.java:29) - Entering application.
>0 [main] INFO Log4JTest  - Entering application.
>program executing
> INFO [main] (Log4JTest.java:31) - Exiting application.
>0 [main] INFO Log4JTest  - Exiting application.
>-----------------------------------------------------------------------
-
>
>The test program is:
>
>-------------------------------------------------------------------
>import org.apache.log4j.Logger;
>import org.apache.log4j.BasicConfigurator;
>
>public class Log4JTest
>{
>
>    // Define a static logger variable so that it references the
>    // Logger instance named "Log4JTest".
>    static Logger logger = Logger.getLogger(Log4JTest.class);
>
>    public static void main(String[] args)
>    {
>
>        // Set up a simple configuration that logs on the console.
>        BasicConfigurator.configure();
>
>        logger.info("Entering application.");
>            System.out.println("program executing");
>        logger.info("Exiting application.");
>    }
>}
>-------------------------------------------------------------------
>
>
>PS. I don't    get the above error if I specify the output path to be:
>       log4j.appender.ROOT_APPENDER.File=debug.log
>    Oh, I aslo tried:
>       log4j.appender.ROOT_APPENDER.File=/WEB-INF/logs/debug.log
>    But got same error.
>
>Thanks in advance!
>
>-Yan
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to