This content has been marked as final.
Show 3 replies
-
1. Re: separating Hibernate and Struts logs
jaikiran Feb 7, 2008 9:18 AM (in response to babygodzilla)Yes it's possible. Something like this (just an example, the syntax and other stuff might be incorrect):
<appender name="HIB_APPENDER" class="org.apache.log4j.FileAppender"> <param name="File" value="D:/log/HibernateLogs.log"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c] %m%n"/> </layout> </appender> <appender name="STRUTS_APPENDER" class="org.apache.log4j.FileAppender"> <param name="File" value="D:/log/StrutsLogs.log"/> <param name="Append" value="false"/> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{ISO8601} %-5p [%c] %m%n"/> </layout> </appender> <category name="org.hibernate"> <appender-ref ref="HIB_APPENDER"/> </category> <category name="org.apache.struts"> <appender-ref ref="STRUTS_APPENDER"/> </category>
-
2. Re: separating Hibernate and Struts logs
babygodzilla Feb 7, 2008 2:25 PM (in response to babygodzilla)thanks! the hibernate part works, but the Struts one did not. i suspect its because there is this in jboss-log4j.xml
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
<category name="org.apache">
<priority value="INFO"/>
</category>
my guess is since org.apache.struts2 is a subset of org.apache, the configuration you gave me did not work. can we make a category within a category? -
3. Re: separating Hibernate and Struts logs
jaikiran Feb 8, 2008 10:51 AM (in response to babygodzilla)I actually have something like this in my log4j file:
<category name="org.jboss"> <priority value="WARN"/> </category> <category name="org.jboss.system"> <priority value="INFO" /> </category>
I see logs being generated for org.jboss.system (which is a sub-package under org.jboss) at INFO level and that for all other classes of org.jboss (and its subfolders) being generated at WARN level. How does your configuration look like after the changes you have done?