Sachidananda Dash [
http://community.jboss.org/people/sachi.dash] created the discussion
"Re: Performance issue related to logging in JBOSS 5"
To view the discussion, visit:
http://community.jboss.org/message/568091#568091
--------------------------------------------------------------
Hi Francesco,
Here is the configuration of my jboss-log4j.xml
<!-- A time/date based rolling appender -->
<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.log.dir}/server.log"/>
<param name="Append" value="true"/>
<!-- In AS 5.0.x the server log threshold was set by a system
property. In 5.1 and later we are instead using the system
property to set the priority on the root logger (see <root/> below)
<param name="Threshold"
value="${jboss.server.log.threshold}"/>
-->
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Rollover at the top of each hour
<param name="DatePattern"
value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t)
%m%n"/>
<!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A size based file rolling appender-->
<appender name="FILE1"
class="org.jboss.logging.appender.RollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.log.dir}/server.log"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="3"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
</layout>
</appender>
<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->
<appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INOF"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.log.dir}/server.log"/>
<param name="Append" value="true"/>
<!-- In AS 5.0.x the server log threshold was set by a system
property. In 5.1 and later we are instead using the system
property to set the priority on the root logger (see <root/> below)
<param name="Threshold"
value="${jboss.server.log.threshold}"/>
-->
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<!-- Rollover at the top of each hour
<param name="DatePattern"
value="'.'yyyy-MM-dd-HH"/>
-->
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t)
%m%n"/>
<!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
<param name="ConversionPattern" value="%d %-5r %-5p [%c]
(%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A size based file rolling appender-->
<appender name="FILE1"
class="org.jboss.logging.appender.RollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File"
value="${jboss.server.log.dir}/server.log"/>
<param name="Append" value="false"/>
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="3"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c]
%m%n"/>
</layout>
</appender>
<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->
<appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="Target" value="System.out"/>
<param name="Threshold" value="INOF"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{1}] %m%n"/>
</layout>
</appender>
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/568091#568091]
Start a new discussion in Performance Tuning at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]