I have an servlet which should log message with log4j. Under development environment (Windows + Eclipse + tomcat), the log4j is working.
When I deploy the servlet into production (AIX + websphere), it didn't give any log.
I don't know what happened. What is the possible reason? The war file was created by eclipse after verify the logging function was working in development environment. I want to gather more clues before I deploy it again in production.
The java program didn't give any clues. I looked up the SystemOut.log, and the log4j loggers were initialized successfully, however, they didn't say anything went wrong about the log files.
I suspect 2 reasons:
1) the logging directory have drwxr-xr-x privileges, may be the java program don't the right to create file there?
2) The log4j.properties files was strange. When I looked it up at AIX via vi, I discovered there was a ^M after every line ending. Probably unix don't need this carriage return character. Maybe this ^M character messed up the things?
EDIT: I found out there are another log file called SystemErr.log. It contained the error message:
[9/1/11 17:07:43:086 HKT] 00000013 SystemErr R log4j:ERROR setFile(null,true) call failed.
[9/1/11 17:07:43:086 HKT] 00000013 SystemErr R java.io.FileNotFoundException: /bps/log/BpsPdfBill.log (The file access pe rmissions do not allow the specified action.)