8 Replies Latest reply on Mar 17, 2014 9:22 AM by Kuldeep Sharma

    JBOSS 6.1.0 Log Size Issues

    Malik Adeel Imtiaz Newbie

      Dear Gurus,

       

      I have JBOSS 6.1.0 on my production server today (14/March/2014)

       

      Problem is when today i go live suddenly i realize that the log file is getting increased and increased in C Drive and with in 2 hours it get 16 GB.

       

      I stop my production and move it to D drive.

       

      And start the JBOSS but problem still persist it start again increasing and at end of business my log file is 24 GB.

       

      Please help me in this regard.

       

      I deploy JBOSS 6.1.0 on Windows 2008 Enterprise Edition R2 64 Bit.

       

      Using JDK 1.6 64 Bit.

       

      Thanks

      Adeel Imtiaz

        • 1. Re: JBOSS 6.1.0 Log Size Issues
          Wolf-Dieter Fink Master

          Logfile size depends on what you are logging.

          Maybe you have a configuration that log DEBUG or TRACE which can be increase the log very fast.

          Other issue can be that you are logging with your application on WARN/INFO level huge messages.

           

          You need to check what messages you see in the logfile.

          Maybe you can compare the category settings with a fresh jboss instance, maybe someone replace the logging configuration.

          • 2. Re: JBOSS 6.1.0 Log Size Issues
            Malik Adeel Imtiaz Newbie

            Dear

             

            Thank you for your quick reply.

             

            Can you please help me how can i stop the logging of every type.

             

            Because right now it is over my head. Because today i just got it live the production server and this problem comes.

             

            So how can i just stop the logging please guide me thanks.

             

            Adeel Imtiaz

            • 3. Re: JBOSS 6.1.0 Log Size Issues
              Wolf-Dieter Fink Master

              What version of JBoss do you use?

              Is it AS6  (start with run.bat)

              you should look for a jboss-log4j.xml file

              Is it AS7, EAP6 or newer (start with standalone or domain.bat)

              you should look into the standalone.xml or domain.xml file

               

              You find a list of categories like this:

              <logger category="org.jboss.......">

                <level name="INFO"/>

               

              so you need to check whether the level is DEBUG/TRACE for some categories. The jboss* categories should not set so in production.

               

              For your application you need to check your categories.

              If you look into the logfile you see entries

              <date> ERROR|INFO|DEBUG....  <a category> < a message>

              so compare the level and the category and reduce the levels.

               

              i.e. a category in the logfile "org.jboss.my.example"

              might be activated by a category in the configuration "org.jboss"

              For the first shot I would say each DEBUG/TRACE setting in the configuration might be suspect.

              Also if the <root-logger> is set to this.

              • 4. Re: JBOSS 6.1.0 Log Size Issues
                Malik Adeel Imtiaz Newbie

                Thank you for your reply. let me check this and then i will get back to you. once again thank you so much.

                • 5. Re: JBOSS 6.1.0 Log Size Issues
                  Malik Adeel Imtiaz Newbie

                  Dear Wolf-Dieter fink,

                   

                  Please see that I did not find any of the file you have mentioned as below.

                   

                  What version of JBoss do you use?

                  Is it AS6  (start with run.bat)

                  you should look for a jboss-log4j.xml file

                  Is it AS7, EAP6 or newer (start with standalone or domain.bat)

                  you should look into the standalone.xml or domain.xml file

                   

                  I have Jboss AS 6.1.0 and i start the server through RUN.BAT.

                   

                  Today same problem in 10 minutes it get 13 GB space only the log file.

                   

                  Thanks

                  Adeel Imtiaz

                  • 6. Re: JBOSS 6.1.0 Log Size Issues
                    Malik Adeel Imtiaz Newbie

                    I got the file name

                     

                    jboss-logging.xml

                     

                    <?xml version="1.0" encoding="UTF-8"?>

                    <!-- ===================================================================== -->

                    <!--                                                                       -->

                    <!--  Logging System Configuration                                         -->

                    <!--                                                                       -->

                    <!-- ===================================================================== -->

                    <logging xmlns="urn:jboss:logging:6.0" xmlns:b="urn:jboss:bean-deployer:2.0">

                       <!-- ================================= -->

                       <!-- Preserve messages in a local file -->

                       <!-- ================================= -->

                       <!-- A time/date based rolling handler -->

                       <periodic-rotating-file-handler

                             file-name="${jboss.server.log.dir}/server.log"

                             name="FILE"

                             autoflush="true"

                             append="true"

                             suffix=".yyyy-MM-dd">  <!-- To roll over at the top of each hour, use ".yyyy-MM-dd-HH" instead -->

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <formatter>

                             <!-- To revert back to simple stack traces without JAR versions, change "%E" to "%e" below. -->

                             <!-- Uncomment this to get the class name in the log as well as the category

                             <pattern-formatter pattern="%d %-5p [%c] %C{1} (%t) %s%E%n"/>

                             -->

                             <!-- Uncomment this to log without the class name in the log -->

                             <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"/>

                          </formatter>

                       </periodic-rotating-file-handler>

                       <!-- A size based file rolling appender

                       <size-rotating-file-handler

                             file-name="${jboss.server.log.dir}/server.log"

                             name="FILE"

                             autoflush="true"

                             append="true"

                             rotate-size="500k"

                             max-backup-index="5">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <formatter>

                             <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>

                          </formatter>

                       </size-rotating-file-handler>

                       -->

                       <!-- ============================== -->

                       <!-- Append messages to the console -->

                       <!-- ============================== -->

                       <console-handler name="CONSOLE" autoflush="true" target="System.out">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <level name="INFO"/>

                          <formatter>

                             <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] %s%E%n"/>

                          </formatter>

                       </console-handler>

                       <!-- ====================== -->

                       <!-- More Appender examples -->

                       <!-- ====================== -->

                       <!-- Buffer events and log them asynchronously

                       <async-handler name="ASYNC">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <sub-handlers>

                             <handler-ref name="FILE"/>

                             <handler-ref name="CONSOLE"/>

                             <handler-ref name="SMTP"/>

                          </sub-handlers>

                       </async-handler>

                       -->

                       <!-- EMail events to an administrator

                       <log4j-appender name="SMTP" class="org.apache.log4j.net.SMTPAppender">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <level name="ERROR"/>

                          <properties>

                             <property name="to">admin@myhost.domain.com</property>

                             <property name="from">nobody@myhost.domain.com</property>

                             <property name="subject">JBoss Sever Errors</property>

                             <property name="SMTPHost">localhost</property>

                             <property name="bufferSize">10</property>

                          </properties>

                          <formatter>

                             <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>

                          </formatter>

                       </log4j-appender>

                       -->

                       <!-- Syslog events

                       <log4j-appender name="SYSLOG" class="org.apache.log4j.net.SyslogAppender">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <properties>

                             <property name="facility">LOCAL7</property>

                             <property name="facilityPrinting">true</property>

                             <property name="syslogHost">localhost</property>

                          </properties>

                          <formatter>

                             <pattern-formatter pattern="[%d,%c{1}] %m%n"/>

                          </formatter>

                       </log4j-appender>

                       -->

                       <!-- Log events to JMS (requires a topic to be created)

                       <log4j-appender name="JMS" class="org.apache.log4j.net.JMSAppender">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <level name="ERROR"/>

                          <properties>

                             <property name="topicConnectionFactoryBindingName">

                                --><!-- Use injection so that an implicit dependency is formed - TODO: get the correct property name --><!--

                                <b:inject bean="myTopicBiding" property="name"/>

                             </property>

                             <property name="topicBindingName">topic/MyErrorsTopic</property>

                          </properties>

                       </log4j-appender>

                       -->

                       <!-- Log events through SNMP

                       <log4j-appender name="TRAP_LOG" class="org.apache.log4j.ext.SNMPTrapAppender">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <level name="DEBUG"/>

                          <properties>

                             <property name="implementationClassName">org.apache.log4j.ext.JoeSNMPTrapSender</property>

                             <property name="managementHost">127.0.0.1</property>

                             <property name="managementHostTrapListenPort">162</property>

                             <property name="enterpriseOID">1.3.6.1.4.1.24.0</property>

                             <property name="localIPAddress">127.0.0.1</property>

                             <property name="localTrapSendPort">161</property>

                             <property name="genericTrapType">6</property>

                             <property name="specificTrapType">12345678</property>

                             <property name="communityString">public</property>

                             <property name="forwardStackTraceWithTrap">true</property>

                             <property name="applicationTrapOID">1.3.6.1.4.1.24.12.10.22.64</property>

                          </properties>

                          <formatter>

                             <pattern-formatter pattern="%d,%p,[%t],[%c],%m%n"/>

                          </formatter>

                       </log4j-appender>

                       -->

                       <!-- Emit events as JMX notifications

                       <log4j-appender name="JMX" class="org.jboss.monitor.services.JMXNotificationAppender">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <level name="WARN"/>

                          <properties>

                             <property name="objectName">jboss.system:service=Logging,type=JMXNotificationAppender</property>

                          </properties>

                          <formatter>

                             <pattern-formatter pattern="%d %-5p [%c] %m"/>

                          </formatter>

                       </log4j-appender>

                       -->

                       <!-- Security AUDIT Appender

                       <periodic-rotating-file-handler

                             name="AUDIT"

                             autoflush="true"

                             file-name="${jboss.server.log.dir}/audit.log"

                             suffix=".yyyy-MM-dd"

                             append="true">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <formatter>

                             <pattern-formatter pattern="%d %-5p [%c] (%t:%x) %m%n"/>

                          </formatter>

                       </periodic-rotating-file-handler>

                       -->

                       <!-- =============================================== -->

                       <!-- Limit categories                                -->

                       <!-- if enabling "trace" at root logger level,       -->

                       <!-- use limit category settings to disable trace    -->

                       <!-- for packages that you don't want to trace       -->

                       <!-- =============================================== -->

                       <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->

                       <logger category="org.apache">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the jacorb category to WARN as its INFO is verbose -->

                       <logger category="jacorb">

                          <level name="WARN"/>

                       </logger>

                       <!-- Limit JSF to INFO as its FINE is verbose -->

                       <logger category="javax.enterprise.resource.webcontainer.jsf">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->

                       <logger category="org.jgroups">

                          <level name="WARN"/>

                       </logger>

                       <!-- Limit the org.quartz category to INFO as its DEBUG is verbose -->

                       <logger category="org.quartz">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the com.sun category to INFO as its FINE is verbose -->

                       <logger category="com.sun">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the sun category to INFO as its FINE is verbose -->

                       <logger category="sun">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the javax.xml.bind category to INFO as its FINE is verbose -->

                       <logger category="javax.xml.bind">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the springframework category to WARN-->

                       <logger category="org.springframework">

                          <level name="WARN"/>

                       </logger>

                       <!-- Limit JBoss categories

                       <logger category="org.jboss">

                          <level name="INFO"/>

                       </logger>  -->

                       <!-- Or limit individual JBoss categories

                       <logger category="org.jboss.web">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.tm">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.jdbc">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.on">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.services">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.bootstrap">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.kernel">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.beans">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.injection">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.annotation">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.system">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.mx">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.jmx">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.invocation">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.classloader">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.classloading">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.deployment">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.deployers">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.dependency">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.metadata">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.detailed">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.logging">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.logbridge">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.aop">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.joinpoint">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.util">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.ha">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.resource">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.varia">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.net">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.security">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.console">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.wsf">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.ejb">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.ejb3">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.jpa">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.vfs">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.xb">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.naming">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.wsf">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.ws">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.mail">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.monitor">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.remoting">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.profileservice">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.cache">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.proxy">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.jms">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.messaging">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.webbeans">

                         <level name="INFO" />

                       </logger>

                       <logger category="org.jboss.managed">

                         <level name="INFO" />

                       </logger>

                       -->

                       <!-- Limit Arjuna transaction manager -->

                       <logger category="com.arjuna.ats">

                         <level name="INFO" />

                       </logger>

                       <!-- Limit Hibernate

                       <logger category="org.hibernate">

                         <level name="INFO" />

                       </logger>

                       -->

                       <!-- Limit Ajax4jsf

                       <logger category="org.ajax4jsf">

                         <level name="INFO" />

                       </logger>

                       -->

                       <!-- Limit JNP

                        <logger category="org.jnp">

                          <level name="INFO" />

                        </logger>

                       -->

                       <!-- Limit the JSR77 categories -->

                       <logger category="org.jboss.management">

                          <level name="INFO"/>

                       </logger>

                       <!-- Limit the verbose facelets compiler -->

                       <!-- Also suppress error with legacy facelets (JBAS-7600) -->

                       <logger category="facelets.compiler">

                          <level name="WARN"/>

                          <filter>

                             <not>

                                <match pattern="Error\sLoading\sLibrary.*jsf-libs/jsf-impl"/>

                             </not>

                          </filter>

                       </logger>

                       <!-- Limit the verbose ajax4jsf cache initialization

                       <logger category="org.ajax4jsf.cache">

                          <level name="WARN"/>

                       </logger>

                       -->

                       <!-- Limit the verbose embedded jopr categories

                       <logger category="org.rhq">

                          <level name="WARN"/>

                       </logger>

                       -->

                       <!-- Limit the verbose seam categories

                       <logger category="org.jboss.seam">

                          <level name="WARN"/>

                       </logger>

                       -->

                       <!-- Show the evolution of the DataSource pool in the logs [inUse/Available/Max]

                       <logger category="org.jboss.resource.connectionmanager.JBossManagedConnectionPool">

                         <level name="TRACE"/>

                       </logger>

                       -->

                       <!-- Category specifically for Security Audit Provider

                       <logger category="org.jboss.security.audit.providers.LogAuditProvider" additivity="false">

                         <level name="TRACE"/>

                         <appender-ref ref="AUDIT"/>

                       </logger>

                       -->

                       <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->

                       <logger category="org.jboss.serial">

                          <level name="INFO"/>

                       </logger>

                       <!-- Decrease the priority threshold for the org.jboss.varia category

                       <logger category="org.jboss.varia">

                         <level name="DEBUG"/>

                       </logger>

                       -->

                       <!-- Enable JBossWS message tracing

                       <logger category="org.jboss.ws.core.MessageTrace">

                         <level name="TRACE"/>

                       </logger>

                       -->

                       <!-- Enable System log message tracing

                       <logger category="org.jboss.system">

                         <level name="TRACE"/>

                       </logger>

                       <logger category="org.jboss.ejb.plugins">

                         <level name="TRACE"/>

                       </logger>

                       -->

                       <!--

                           | Logs these events to SNMP:

                               - server starts/stops

                               - cluster evolution (node death/startup)

                               - When an EJB archive is deployed (and associated verified messages)

                               - When an EAR archive is deployed

                       <logger category="org.jboss.system.server.Server">

                          <level name="INFO"/>

                          <handlers>

                             <handler-ref name="TRAP_LOG"/>

                          </handlers>

                       </logger>

                       <logger category="org.jboss.ha.framework.interfaces.HAPartition.lifecycle">

                          <level name="INFO"/>

                          <handlers>

                             <handler-ref name="TRAP_LOG"/>

                          </handlers>

                       </logger>

                       <logger category="org.jboss.deployment.MainDeployer">

                          <level name="ERROR"/>

                          <handlers>

                             <handler-ref name="TRAP_LOG"/>

                          </handlers>

                       </logger>

                       <logger category="org.jboss.ejb.EJBDeployer">

                          <level name="INFO"/>

                          <handlers>

                             <handler-ref name="TRAP_LOG"/>

                          </handlers>

                       </logger>

                       <logger category="org.jboss.deployment.EARDeployer">

                          <level name="INFO"/>

                          <handlers>

                             <handler-ref name="TRAP_LOG"/>

                          </handlers>

                       </logger>

                       -->

                        <!-- Reduce org.mc4j stuff in the logs -->

                       <logger category="org.mc4j">

                          <level name="WARN"/>

                       </logger>

                       <!-- Clustering logging -->

                       <!-- Uncomment the following to redirect the org.jgroups and

                          org.jboss.ha categories to a cluster.log file.

                       <size-rotating-file-handler

                             file-name="${jboss.server.log.dir}/cluster.log"

                             name="CLUSTER"

                             append="false"

                             rotate-size="500k"

                             max-backup-index="5"

                             autoflush="true">

                          <error-manager>

                             <only-once/>

                          </error-manager>

                          <formatter>

                             <pattern-formatter pattern="%d %-5p [%c] %m%n"/>

                          </formatter>

                       </size-rotating-file-handler>

                       <logger category="org.jgroups">

                          <level name="DEBUG" />

                          <handlers>

                             <handler-ref name="CLUSTER"/>

                          </handlers>

                       </logger>

                       <logger category="org.jboss.ha">

                          <level name="DEBUG" />

                          <handlers>

                             <handler-ref name="CLUSTER"/>

                          </handlers>

                       </logger>

                       -->

                       <!-- This is a temporary workaround for https://jira.jboss.org/jira/browse/EMBJOPR-280 and

                            should be removed once that bug if fixed in the bundled admin-console war. -->

                       <logger category="org.rhq.plugins.jbossas5.ApplicationServerComponent">

                          <level name="FATAL"/>

                       </logger>

                       <!-- ======================= -->

                       <!-- Setup the Root category -->

                       <!-- ======================= -->

                       <root-logger>

                          <!-- Set the root logger priority via a system property, with a default value. -->

                          <level name="${jboss.server.log.threshold:INFO}"/>

                          <handlers>

                             <handler-ref name="CONSOLE"/>

                             <handler-ref name="FILE"/>

                          </handlers>

                       </root-logger>

                    </logging>

                     

                     

                    Please help Thanks

                    Adeel Imtiaz

                    • 7. Re: JBOSS 6.1.0 Log Size Issues
                      Wolf-Dieter Fink Master

                      You might set jboss.server.log.threshold somewhere in your environment and overwrite the default INFO.

                      But as I said before you should look to the logfiles and see what category and level is fooding your log.

                      And you need to decide whether this should be logged or not and reduce the level accordingly

                      • 8. Re: JBOSS 6.1.0 Log Size Issues
                        Kuldeep Sharma Novice

                        As Wolf-Dieter said check logfile and see category and level.

                        In the mean while you can change logging rotation on size bases and keep few file.

                        Uncomment below and change rotate-size and max-backup-index parameter as per your requirements.

                         

                        <!-- A size based file rolling appender

                           <size-rotating-file-handler

                                 file-name="${jboss.server.log.dir}/server.log"

                                 name="FILE"

                                 autoflush="true"

                                 append="true"

                                 rotate-size="500k"

                                 max-backup-index="5">

                              <error-manager>

                                 <only-once/>

                              </error-manager>

                              <formatter>

                                 <pattern-formatter pattern="%d %-5p [%c] (%t) %m%n"/>

                              </formatter>

                           </size-rotating-file-handler>

                           -->

                         

                        Thanks!