Re: Logging Strategy/best practice
- From: iksrazal@xxxxxxxxxxxx
- Date: 28 Jul 2005 09:56:49 -0700
Just a quick tip - Log4J works differently in JBoss then elsewhere.
Typically you put log4.xml/properties in the root of your classpath, or
alternatively load it via a servlet with loadOnStartup. JBoss ignores
that practice - for better or worse.
To control logging with JBoss 4.0.1, I edit:
jboss/server/default/conf/log4j.xml
And have:
<appender name="CALLCENTREWEB_FILE"
class="org.apache.log4j.FileAppender">
<param name="File"
value="${jboss.server.home.dir}/log/call_centre_web.log" />
<param name="Append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd MMM yyy HH:mm:ss},
%-6p %C:%M:%L %m %n" />
</layout>
</appender>
<category name="com.hostedtelecom.callcentreweb">
<priority value="DEBUG" />
<appender-ref ref="CALLCENTREWEB_FILE" />
</category>
Hibernate and Spring have there own appenders. Such as (Not tested in
Jboss, just tomcat, but idea is the same):
log4j.category.org.springframework=WARN, console2, apacheOrg
log4j.category.net.sf.hibernate=WARN, console2, apacheOrg
You'll need to convert those to the xml format JBoss uses. Search the
JBoss group for details or post a question there.
HTH,
iksrazal
http://www.braziloutsource.com/
.
- References:
- Logging Strategy/best practice
- From: Lord0
- Logging Strategy/best practice
- Prev by Date: Re: J2ME background image
- Next by Date: Vector & memory fragmentation
- Previous by thread: Logging Strategy/best practice
- Next by thread: Re: Logging Strategy/best practice
- Index(es):