Bug 1266360 - [GSS](6.4.z) Asynchronous logging doesn't work with periodic-size-rotating-file-handler
Summary: [GSS](6.4.z) Asynchronous logging doesn't work with periodic-size-rotating-fi...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging
Version: 6.4.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.11
Assignee: Panagiotis Sotiropoulos
QA Contact: Nikoleta Hlavickova
URL:
Whiteboard:
Depends On:
Blocks: 1306270 eap6411-payload
TreeView+ depends on / blocked
 
Reported: 2015-09-25 06:40 UTC by Ranjith Pulluru
Modified: 2020-02-14 17:34 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
: 1306270 (view as bug list)
Environment:
Last Closed: 2017-01-17 13:11:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-6092 0 Major Verified PeriodicSizeRotatingFileHandler's are always replaced during boot 2019-10-11 16:07:56 UTC
Red Hat Issue Tracker WFCORE-1018 0 Major Resolved PeriodicSizeRotatingFileHandler's are always replaced during boot 2019-10-11 16:07:56 UTC

Description Ranjith Pulluru 2015-09-25 06:40:04 UTC
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.

Comment 1 James Perkins 2015-09-28 17:11:39 UTC
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.

Comment 3 Prasanth Pagolu 2016-02-02 11:02:04 UTC
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

Comment 5 Panagiotis Sotiropoulos 2016-02-11 13:56:51 UTC
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>

Comment 6 Mike McCune 2016-03-28 23:23:30 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 7 Jiří Bílek 2016-09-27 09:12:58 UTC
Verified with EAP 6.4.11.CP.CR1

Comment 8 Petr Penicka 2017-01-17 13:11:54 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.


Note You need to log in before you can comment on or make changes to this bug.