This content has been marked as final.
Show 2 replies
-
1. Re: Custom Logger in JBoss
jbossacm Nov 1, 2007 3:46 PM (in response to jkv)Have you tried defining your loggers inside the log4j.xml that you place in your server's conf directory?
It would look something like this:
Inside your class:private Logger dataLog = Logger.getLogger("YOUR_LOGGER");
Inside your log4j:<appender name="YOUR_LOGGER_FILE" class="org.jboss.logging.appender.DailyRollingFileAppender"> <param name="File" value="${jboss.server.home.dir}/log/yourFile.log"/> <param name="Append" value="true"/> THE REST OF YOUR CONFIGURATION </appender> <category name="YOUR_LOGGER"> <appender-ref ref="YOUR_LOGGER_FILE"/> </category>
This might help you out. -
2. Re: Custom Logger in JBoss
jkv Nov 2, 2007 2:05 AM (in response to jkv)I have a three different log4j.xml files for three different ears that I have deployed.
Say I am deploying A.ear, B.ear and C.ear to JBoss, I will have three folder by the name A, B and C under the conf directory of the Server. Each of these folders will have the log4j.xml file for that particular ear.
I am using my custom Logger say MyLogger which extends Logger for logging events. I have included this MyLogger.jar file in all the ear files.
I also have the JBoss log4j.xml file in the conf directory undisturbed.