We are having a web application using log4j deployed on weblogic 9.2
We are using log4j for application logging. When giving the log file name for the file appender
without the path the log file gets generated in the domain folder of weblogic server
But if I add any path to it the log file doesnt get generated
None of the above combination works.
I even tried manually creating the xyzlogs folder under the doamin folder on weblogic server but still the log file doesnt get generated.
On the contrary it is not a good practice to let log4j decide where to log files based on the relative path. Make sure the same path exists in all environments. Its easier for developers that way
Joined: Jul 14, 2009
That may not be possible every time. On development it could be D: where as on QA or production it could be F: or H:
Also sometimes the development is on Windows and QA/Prod are Unix servers.
Joined: Oct 26, 2009
you can also try moving log4j properties file out of WAR into root of weblogic domain where WAR is deployed. I thought this is a best approach as when ever you do make any changes you dont need re-deploy the WAR but yes you need to bounce the server
To answer you question. I think i also got this issue. Some times when you do'nt mention absolute path, it may create the log files under root drive where domain is running. For eg, if your domain is running under c:\domains\sampleDomain it may create log file under c:\xyzlogs\xyz.log
Check it out and also make sure you have enabled the appender you are refering.