I’m trying to understand how to setup logging using log4j with Geronimo. Found the article http://cwiki.apache.org/GMOxDOC21/configuring-application-specific-logging-with-log4j.html but I miss an explanation of the concepts behind the logging. Likely the problem I have with implementing the logging following the article are due to this missing understanding. Before bothering anyone with my faulty source code I would therefore like to know whether I have understood the concepts correctly;
1. Each deployed WAR can maintain separate log file(s), by including a ‘log4j.properties’ file in the WAR and a definition of where to unpack it in the ‘geronimo-web.xml’ deployment file.
You also need a geronimo plan for the war with an ApplicationLog4jConfigurationGBean gbean to tell log4j about the special configuration for the war's logging.
[Gert] I thought the ‘geronimo-web.xml’ was the Geronimo plan for the war, i.e. I have inserted the ApplicationLog4jConfigurationGBean bean in this file… do I need another file as well?
yes. If you don't do anything your app's logging will also end up in this server log file. You only need to follow the doc instructions if you want your app's logging to go to a separate file from the normal server logging.
[Gert] So if I don’t do anything I should see my log messages in the default log (… I dont). And if I follow the instructions on http://cwiki.apache.org/GMOxDOC21/configuring-application-specific-logging-with-log4j.html I should see them somewhere else.
I don't know if you can look at other log files using the console log viewer.
[Gert] Ok… I’ll try and see… just wondered why there is a drop down box on the log viewer. Seems to indicate that you can have multiple logs.
hope this helps