I have created the file ‘webapp/META-INF/documentcrawler-log4j.properties’.
My ‘pom.xml’ file contains;
<copy-file relative-to="server" dest-dir="var/log">META-INF/documentcrawler-log4j.properties</copy-file>
I have defined the ‘geronimo-web.xml’ file as;
<!-- Enable logging using log4j -->
<gbean name="DirectoryLog4jConfiguration" class="org.apache.geronimo.system.logging.log4j.ApplicationLog4jConfigurationGBean">
When deploying the WAR file Geronimo throws a ‘file not found’ exception, pointing to [Geronimo home]/var/log/documentcrawler-log4j.properties. This seems to indicate to me that the file ‘documentcrawler-log4j.properties’ are not copied to the right folder in Geronimo as part of the deployment. This is not surprising as the copy statement is in the ‘pom.xml’ file, not in the ‘geronimo-web.xml’ file…
Perhaps my problem lies in the sentence ‘3. …by including something like this in the pom.xml that generates geronimo-plugin.xml’ in the article http://cwiki.apache.org/GMOxDOC21/configuring-application-specific-logging-with-log4j.html. In my environment the ‘geronimo-web.xml’ file is NOT generated based on the pom. It is simply taken as I have defined it…
What am I doing wrong?
From: David Jencks
Sent: Dienstag, 21. April 2009 18:10
Subject: Re: Concepts behind log file per WAR using log4j
On Apr 21, 2009, at 8:52 AM,
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.
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.
I don't know if you can look at other log files using the console log viewer.
hope this helps