Bug 1266360 - [GSS](6.4.z) Asynchronous logging doesn't work with periodic-size-rotating-file-handler
[GSS](6.4.z) Asynchronous logging doesn't work with periodic-size-rotating-fi...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
6.4.3
Unspecified Unspecified
unspecified Severity unspecified
: CR1
: EAP 6.4.11
Assigned To: Panagiotis Sotiropoulos
Nikoleta Ziakova
:
Depends On:
Blocks: 1306270 eap6411-payload
  Show dependency treegraph
 
Reported: 2015-09-25 02:40 EDT by Ranjith Pulluru
Modified: 2017-01-19 11:02 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1306270 (view as bug list)
Environment:
Last Closed: 2017-01-17 08:11:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBEAP-6092 Major Verified PeriodicSizeRotatingFileHandler's are always replaced during boot 2018-05-18 12:21 EDT
JBoss Issue Tracker WFCORE-1018 Major Resolved PeriodicSizeRotatingFileHandler's are always replaced during boot 2018-05-18 12:21 EDT

  None (edit)
Description Ranjith Pulluru 2015-09-25 02:40:04 EDT
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 13:11:39 EDT
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 06:02:04 EST
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 08:56:51 EST
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 19:23:30 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 7 Jiří Bílek 2016-09-27 05:12:58 EDT
Verified with EAP 6.4.11.CP.CR1
Comment 8 Petr Penicka 2017-01-17 08:11:54 EST
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.