I just put together an existing web application at work that should log my activity with Log4J. I set up my workspace exactly as I was told, and everything else (db connection, authentication, etc.) works fine, except that nothing is written to the log file. Other similar applications do not have logging problems.
I looked at the WebSphere console when starting the application and there are no errors that can indicate why Log4J is not logging.
I mentioned this to another developer (who once worked on this application, but not for some time and is more outdated than I did on it), who noticed that this was a very strange behavior, but had no idea why he may not log or report any errors.
I looked at the configuration file and the properties file, and everything looks fine. I suspect Log4J does not even read log4j.xml, but I am not sure about that. It's been a while since I worked with Log4J - does anyone have any good tips to fix this problem?
PS: There are instances of this application that are deployed on different test / QA / prod servers, and these instances are all logged in order. It is only on local workstations that journaling seems to fail.
Update: . So it looks like the problem is with how the application is being deployed. I changed the classloader mode to "Parent Last" and I see that the Log4J file is at least now being read. And the first action that I am trying starts ClassNotFoundExceptionis saying that org.apache.commons.logging.impl.Log4jFactoryit cannot be found.
:
- ... WAR - - , - -. , , . - - , ClassNotFoundException. commons-logging.jar, JavaEE, ( "" ).
, ( JAR), , , , .
( org.apache.commons.logging.LogFactory META-INF/services , : "org.apache.commons.logging.impl.Log4jFactory" ) : Websphere SystemOut.log, , , .