Log4j: ERROR setFile (null, true) call failed.java.io.FileNotFoundException:

I get the following error while compiling an application

log4j:ERROR setFile(null,true) call failed.java.io.FileNotFoundException:\gel\ms\ex\ms.log (The system cannot find the path specified)

Below is my log4j configuration file:

#root log level
log4j.rootCategory=debug, R
log4j.logger.java.sql=DEBUG
log4j.logger.com.ibatis=DEBUG

# First type of log, output to file
log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/gel/ms/ex/ms.log
log4j.appender.R.MaxFileSize=5000KB
log4j.appender.R.MaxBackupIndex=3
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%40c] %5p - %m%n

And my hierachy project folder

MS (project name)

  • Java Resource

  • Webcontext

    2.a -META-INF

    2.b -WEB-INF

Please inform. Thanks

+3
source share
2 answers

For a quick fix, set the absolute path.

0
source

The above error gives you a hint that the appender file is not available / readable with current user access.

In short, we can say that without administrative rights, no one can write a file to drive C:

, log4j.appender.FILE.File, , /tmp/test.log. .

0

All Articles