Error: "setFile(null,false) call failed" when using log4j
960214Sep 5 2012 — edited Sep 6 2012I have two applications running as two users and writing logs to same log!! (This is to make developer life easy for debugging)
user1 & user1 belongs to same group and two applications start with "umask 0" .. which means logs created will have -rw-rw-rw- permissions.
And logs/ directory is owned by same group and belongs to user1. And logs directory have 777 permissions given...
But, during my applications being trying to write logs, i am seeing below stack trace at times and misses out logging logged by user2..
and at times both processes will be able to log.....
Want to know what log4j setFile() does? or is it like log4j gets lock?
Experts, any inputs would help me resolve this!!!
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /logs/supportservices.log (Permission denied)
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:290)
at org.apache.log4j.RollingFileAppender.setFile(Rolli ngFileAppender.java:194)
at org.apache.log4j.FileAppender.activateOptions(File Appender.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)