It's not a secret anymore!
The moose likes Ant, Maven and Other Build Tools and the fly likes log4j:ERROR setFile(null,true) call failed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "log4j:ERROR setFile(null,true) call failed." Watch "log4j:ERROR setFile(null,true) call failed." New topic

log4j:ERROR setFile(null,true) call failed.

Smriti Anchu
Ranch Hand

Joined: Dec 21, 2004
Posts: 40

I am getting the following error
"log4j:ERROR setFile(null,true) call failed." When i try to run the application.

The below code is the sample class file which is used for put properties into the the Properties file.

In the action class, I am calling the above class to write the logger

When I try to run the application, it is giving me the following error when trying to write it to the log file

log4j:ERROR setFile(null,true) call failed. "Mail.log" (The filename, directory name, or volume label syntax is incorrect)
at Method)
at<init>(Unknown Source)
at<init>(Unknown Source)
at org.apache.log4j.FileAppender.setFile(
at org.apache.log4j.RollingFileAppender.setFile(
at org.apache.log4j.FileAppender.activateOptions(
at org.apache.log4j.config.PropertySetter.activate(
at org.apache.log4j.config.PropertySetter.setProperties(
at org.apache.log4j.config.PropertySetter.setProperties(
at org.apache.log4j.PropertyConfigurator.parseAppender(
at org.apache.log4j.PropertyConfigurator.parseCategory(
at org.apache.log4j.PropertyConfigurator.configureRootCategory(
at org.apache.log4j.PropertyConfigurator.doConfigure(
at org.apache.log4j.PropertyConfigurator.configure(
at com.test.util.LogHooks.initLogger(
at com.test.util.LogHooks.writeOutputLog(
at com.test.action.MailAction.executeProcess(

Anybody could you please tell me as to how to avoid this error file when trying to run the applicaiton

thanks in advance
Febin Thomas

Joined: Mar 22, 2013
Posts: 1
Its a late replay but it may help someone..

I came across the same issue when using the log4j.

I use a property file file in src/main/resources/ something like..

#log4j.rootLogger=DEBUG, S, R
log4j.rootCategory=S, R

# The following properties configure the console (stdout) appender.
# See for details.
log4j.appender.S = org.apache.log4j.ConsoleAppender
log4j.appender.S.layout = org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern =%d{yyyy-MM-dd HH:mm:ss} %t/%c{1} [%p] %m%n

# The following properties configure the Daily Rolling File appender.
# See for details.
log4j.appender.R = org.apache.log4j.RollingFileAppender
log4j.appender.R.File = "DataSourceFactory.log"
log4j.appender.R.Append = true
#log4j.appender.R.DatePattern = '.'yyy-MM-dd
log4j.appender.R.layout = org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern =%d{yyyy-MM-dd HH:mm:ss} %t/%c{1} [%p] %m%n


removing the double quotes from the log4j.appender.R.File = "DataSourceFactory.log" entry solved my problem easily.
I agree. Here's the link:
subject: log4j:ERROR setFile(null,true) call failed.
It's not a secret anymore!