logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sasanka pusapati <spusapati...@gmail.com>
Subject getting error log4j:ERROR setFile(null,true) on windows
Date Tue, 20 Jul 2010 13:58:26 GMT
Hi All,
             I am getting the "file not found exception" error when running
my application using the below properties file .
Why is log4j unable to create the logs directory on its own? This problem is
seen only on windows , its working fine on linux.
Can some one please help me on this.
------------------------------------------------------------------------------------------------------------------------------------
Error :

log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: logs\test.log (The system cannot find the
path sp
ecified)
        at java.io.FileOutputStream.openAppend(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
        at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
        at
org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java
:156)
        at
org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
-----------------------------------------------------------------------------------------------------------------------------------------



------------------------------------------------------------------------------------------------------------------------------------------
log4j Properties file invoked using PropertyConfigurator.configure :

log4j.rootLogger = debug ,console ,logfile

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d{M/dd/yy hh:mm:ss.SSS a z}
[%-3p] [%t] [%c] %m%n


log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=logs/test.log
log4j.appender.logfile.MaxFileSize=2048KB
log4j.appender.logfile.MaxBackupIndex=3
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d{M/dd/yy hh:mm:ss.SSS a z}
[%-3p] [%t] [%c] %m%n

---------------------------------------------------------------------------------------------------------------------------------------------------------------


Thanks in advance,
SAS.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message