8 Replies Latest reply on Aug 29, 2013 8:36 PM by jamezp

    jboss log truncated on startup

    thisn00bagain

      Im running jboss AS 7.

       

      Im running in standalone-full-ha and my config looks like:

      <periodic-rotating-file-handler name="FILE">

                      <level name="INFO"/>

                      <formatter>

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

                      </formatter>

                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                      <suffix value=".yyyy-MM-dd"/>

                      <append value="true"/>

      </periodic-rotating-file-handler>

       

      But still my log file gets truncated on every startup.

       

      Any ideas?

        • 1. Re: jboss log truncated on startup
          mustaq.pradhan

          Hi David,

          Have you got solution to this? I am having the same problem.

          I am running EAP 6.1 (JBoss 7.1)

          • 2. Re: jboss log truncated on startup
            ybxiang.china

            Are you sure you are using standalone-full-ha.xml? NOT standalone.xml(default)?

            • 3. Re: jboss log truncated on startup
              mustaq.pradhan

              I am using domain configuration.

              • 4. Re: jboss log truncated on startup
                jamezp

                Can you give an example of what your seeing and what you expect to see? Also for domain, which log file seems to be truncated?

                 

                --

                James R. Perkins

                • 5. Re: Re: jboss log truncated on startup
                  mustaq.pradhan

                  My EAP 6.1 is configured on 1(domain controller) + 3(host controller) VMs.

                  On the domain.xml (for a profile) we configured logging as:

                   

                  . . . .

                            <subsystem xmlns="urn:jboss:domain:logging:1.2">

                                  <console-handler name="CONSOLE">

                                      <level name="INFO"/>

                                      <formatter>

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

                                      </formatter>

                                  </console-handler>

                                  <periodic-rotating-file-handler name="FILE">

                                      <formatter>

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

                                      </formatter>

                                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                                      <suffix value=".yyyy-MM-dd"/>

                                      <append value="true"/>

                                  </periodic-rotating-file-handler>

                                  <size-rotating-file-handler name="SIZE" autoflush="true">

                                      <level name="INFO"/>

                                      <formatter>

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

                                      </formatter>

                                      <file relative-to="jboss.server.log.dir" path="server.log"/>

                                      <rotate-size value="100M"/>

                                      <max-backup-index value="10"/>

                                      <append value="true"/>

                                  </size-rotating-file-handler>

                                  <logger category="com.arjuna">

                                      <level name="WARN"/>

                                  </logger>

                                  <logger category="org.apache.tomcat.util.modeler">

                                      <level name="WARN"/>

                                  </logger>

                                  <logger category="sun.rmi">

                                      <level name="WARN"/>

                                  </logger>

                                  <logger category="jacorb">

                                      <level name="WARN"/>

                                  </logger>

                                  <logger category="jacorb.config">

                                      <level name="ERROR"/>

                                  </logger>

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

                                      <level name="DEBUG"/>

                                  </logger>

                                  <root-logger>

                                      <level name="INFO"/>

                                      <handlers>

                                          <handler name="CONSOLE"/>

                                          <handler name="SIZE"/>

                                      </handlers>

                                  </root-logger>

                           </subsystem>

                  . . . . . . . . . . .

                   

                  And our server group configurations are like:

                   

                  . . . . . . . .

                          <server-group name="sands-group-1" profile="crs-profile-1">

                              <jvm name="default">

                                  <heap size="1024m" max-size="1303m"/>

                                  <permgen size="128m" max-size="256m"/>

                                  <jvm-options>

                                      <option value="-verbosegc"/>

                                  </jvm-options>

                              </jvm>

                              <socket-binding-group ref="full-ha-sockets"/>

                              <deployments>

                                  <deployment name="sands-0.0.1-20130823.003355-15.war" runtime-name="sands.war"/>

                              </deployments>

                          </server-group>

                  . . . . . . . . . .

                   

                  Based on this we create 1 to 3 servers on host controllers:

                   

                  . . . . . . . . . .

                          <server name="sands-102" group="sands-group-1" auto-start="true">

                              <socket-bindings port-offset="22"/>

                          </server>

                  . . . . . . . . . .

                   

                  Each of these servers on host controllers creates a server.log in "jboss.server.log.dir" which is on our installation $EAP_HOME/domain/servers/<server_name>/server.log

                  In this example it is: /domain/servers/sands-102/server.log

                   

                  As we defined in our size-rotating-file-handler "SIZE" this log rotates ok based on the size and those rotated files are retained. Only the current log gets truncated each time we restart the server. No difference whether we

                  1. restart only a particular server using cli (/host=j1002/server-config=sands-102:restart), this will truncate only the server.log on that host.

                  2. restart the server-group (/server-group=sands-group-1:restart-servers), this will truncate all the server.log on all hosts for this group

                  2. restart domain and host controllers on all hosts, this will truncate all the server.log on the whole installation.

                   

                  I can try out any other configuration if you suggest.

                  Please help.

                  • 6. Re: Re: jboss log truncated on startup
                    jamezp

                    You have two handlers, FILE and SIZE, configured to use server.log. Since it looks like you're only using SIZE I would remove the FILE handler.

                     

                    --

                    James R. Perkins

                    • 7. Re: jboss log truncated on startup
                      mustaq.pradhan

                      I thought FILE handler will not be in use as I haven't added it to the root-logger.

                      I have removed the FILE (periodic-rotating-file-handler) handler, same result.

                      • 8. Re: Re: jboss log truncated on startup
                        jamezp

                        Well it won't be used, but it will open a file descriptor to the file.

                         

                        I just tried with EAP 6.1 and I don't think anything is being truncated from the file, though I didn't compare it line by line. I configured a size rotating file handler with the same configuration. I also attached the log file which has the start and a restart in it.

                         

                        --

                        James R. Perkins