5 Replies Latest reply on Jan 24, 2015 12:15 PM by Wolf-Dieter Fink

    remove logs older than x days from /standalone/log directory

    Ciprian Orban Newbie

      Hi,

      I an new to JBoss and I need to know how to delete the old log files from /standalone/log. We are using jboss-eap 6.2.

      i tried modifying the standard.xml and standard-ha.xml with the following, but this did now work.

       

      <size-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"/>

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

                <append value="true"/>

           </size-rotating-file-handler>

       

      This did not remove any of the older than 30 days as I would have thought it would do, and when I checked the logs, under /standalone/log I found the following error.

       

      08:04:59,502 DEBUG [org.jboss.as.config] (MSC service thread 1-7) VM Arguments: -D[Standalone] -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.

      08:05:00,098 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse

          at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:141) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.server.ServerService.boot(ServerService.java:324) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:253) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

      Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[103,13]

      Message: JBAS014788: Unexpected attribute 'max-backup-index' encountered

          at org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute(ParseUtils.java:105) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.logging.LoggingSubsystemParser.parsePeriodicRotatingFileHandlerElement(LoggingSubsystemParser.java:679) [jboss-as-logging-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:181) [jboss-as-logging-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.logging.LoggingSubsystemParser.readElement(LoggingSubsystemParser.java:115) [jboss-as-logging-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final-redhat-2.jar:1.1.0.Final-redhat-2]

          at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69) [staxmapper-1.1.0.Final-redhat-2.jar:1.1.0.Final-redhat-2]

          at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1024) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:458) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:145) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:107) [jboss-as-server-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110) [staxmapper-1.1.0.Final-redhat-2.jar:1.1.0.Final-redhat-2]

          at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69) [staxmapper-1.1.0.Final-redhat-2.jar:1.1.0.Final-redhat-2]

          at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:133) [jboss-as-controller-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]

          ... 3 more