Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j:ERROR setFile(null,true) call failed

 
Smriti Anchu
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.
java.io.FileNotFoundException: "Mail.log" (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileOutputStream.openAppend(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at org.apache.log4j.FileAppender.setFile(FileAppender.java:289)
at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:165)
at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:163)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:256)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:132)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:96)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:654)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:612)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:509)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:415)
at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:349)
at com.test.util.LogHooks.initLogger(LogHooks.java:141)
at com.test.util.LogHooks.writeOutputLog(LogHooks.java:155)
at com.test.action.MailAction.executeProcess(MailAction.java:103)
at com.tk.startup.EmailStartUp.main(EmailStartUp.java:45)

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

thanks in advance
Smriti
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic