Description of problem: ======================= - Asynchronous logging doesn't work with periodic-size-rotating-file-handler Version-Release number of selected component (if applicable): ============================================================== - JBoss EAP 6.4.x Steps to Reproduce: =================== 1) Take a fresh JBoss EAP 6.4.x version. 2) Configure periodic-size-rotating-file-handler. 3) Configure async-handler which uses periodic-size-rotating-file-handler 4) Add the async-handler name in root-logger Configuration looks as below in standalone.xml file after the above steps: -------- <subsystem xmlns="urn:jboss:domain:logging:1.5"> <async-handler name="ASYNC"> <level name="ALL"/> <queue-length value="3024"/> <overflow-action value="discard"/> <subhandlers> <handler name="PSRFILE"/> </subhandlers> </async-handler> <periodic-size-rotating-file-handler name="PSRFILE" autoflush="true"> <level name="ALL"/> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t/%X{threadId}) %s%E%n"/> </formatter> <file relative-to="jboss.server.log.dir" path="PSRFILE.log"/> <rotate-size value="200m"/> <max-backup-index value="5"/> <suffix value=".yyyy.MM.dd"/> </periodic-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="org.jboss.as.config"> <level name="DEBUG"/> </logger> <logger category="sun.rmi"> <level name="WARN"/> </logger> <logger category="jacorb"> <level name="WARN"/> </logger> <logger category="jacorb.config"> <level name="ERROR"/> </logger> <root-logger> <level name="INFO"/> <handlers> <handler name="ASYNC"/> </handlers> </root-logger> </subsystem> -------- 5) Then start the JBoss server. Actual results: =============== - PSRFILE contains only startup logging. There is no JBoss server logging in the PSRFILE. Expected results: ================= - Along with JBoss server startup logging there should be JBoss server logging in PSRFILE. Additional info: ================= - I can see this issue in JBoss EAP 6.4.x versions. - I tried using `periodic-size-rotating-file-handler` in custom handler then I can see the complete JBoss server logging in PSRFILE.
During boot the periodic-size-rotating-file-handler is removed and a new one is added. The async-handler still references the old closed one which has a null writer since it was marked for removal. All that needs to be done is the file handler needs to not be removed during the subsystem add. Here's the WildFly fix https://issues.jboss.org/browse/WFCORE-1018.
I've experienced issue with periodic-rotating-file-handler too where the logs are not being rotated and eventually the Jboss server ends up with 'too many open files' error. I am using Jboss EAP 6.3, here is the configuration: <async-handler name="ASYNC"> <level name="INFO"/> <queue-length value="500"/> <overflow-action value="block"/> <subhandlers> <handler name="FILE"/> </subhandlers> </async-handler> .... .... <periodic-rotating-file-handler name="FILE" autoflush="true"> <formatter> <pattern-formatter pattern="%d{HH:mm:ss,SSS} %X{jsessionid} %-5p %X{deviceId} %X{principal} [%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> ... ... <root-logger> <level name="DEBUG"/> <handlers> <handler name="ASYNC"/> </handlers> </root-logger> Could you please suggest a fix or workaround? Regards, Prash
Could you try the custom-handler for EAP 6.3 : <custom-handler name="PSRFILE" class="org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler" module="org.jboss.logmanager"> <level name="TRACE"/> <formatter> <pattern-formatter pattern="%d %-5p [%c] (%t) %s%E%n"/> </formatter> <properties> <property name="fileName" value="${jboss.server.log.dir}/PSRFILE.log"/> <property name="rotateSize" value="1024"/> <property name="suffix" value=".yyyy-MM-dd"/> <property name="maxBackupIndex" value="5"/> <property name="append" value="true"/> <property name="autoFlush" value="true"/> </properties> </custom-handler> <root-logger> <level name="INFO"/> <handlers> <handler name="PSRFILE"/> </handlers> </root-logger>
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions
Verified with EAP 6.4.11.CP.CR1
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.