Bug 1283194 - logViewer cannot show the log file generated by custom handler
Summary: logViewer cannot show the log file generated by custom handler
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging
Version: 6.4.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Panagiotis Sotiropoulos
QA Contact: Nikoleta Hlavickova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-11-18 12:35 UTC by Ranjith Pulluru
Modified: 2019-09-12 09:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 08:43:47 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ranjith Pulluru 2015-11-18 12:35:08 UTC
Description of problem:
=======================
- logViewer cannot show the log file generated by custom 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 custom handler with `periodic-size-rotating-file-handler` in standalone.xml as below.
--------
   <custom-handler name="PERIODIC-SIZE" class="org.jboss.logmanager.handlers.PeriodicSizeRotatingFileHandler" module="org.jboss.logmanager">
       <level name="INFO"/>
       <formatter>
          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
       </formatter>
       <properties>
       <property name="append" value="true"/>
       <property name="level" value="INFO"/>
       <property name="fileName" value="${jboss.server.log.dir}/CustomHandler.log"/>
       <property name="rotateSize" value="50000000"/>
       <property name="suffix" value=".yyyy-MM-dd"/>
       <property name="autoFlush" value="true"/>
   </properties>
--------
3) Add the custom-handler name(PERIODIC-SIZE) in root-logger.
4) Then start the JBoss server.
5) Open the admin console
    AdminConsole -> Runtime tab -> LogViewer

Actual results:
===============
- Cannot view th CustomHandler log file in admin console.


Expected results:
=================
- CustomHandler log file should be shown.

Additional info:
=================

Comment 1 James Perkins 2015-11-18 20:47:08 UTC
This was done intentionally. The log files can only be read if they're a file-handler, periodic-rotating-file-handler, size-rotating-file-handler or periodic-size-rotating-handler resource. A custom-handler cannot be read via the log viewer.

The relative-to path MUST be jboss.server.log.dir for the resource as well.

That said in 6.4 there is a periodic-size-rotating-file-handler so you don't have to use a custom-handler for it.

The add CLI command for the above:
/subsystem=logging/periodic-size-rotating-file-handler=PERIODIC_SIZE:add(append=true, autoflush=true, level=INFO, named-formatter=PATTERN, rotate-size="500M", suffix=".yyyy-MM-dd", file={relative-to=jboss.server.log.dir, path="CustomHandler.log"})

Then you can read the resources:
/subsystem=logging/log-file=CustomHandler.log:read-resource(include-runtime=true)

Comment 2 Panagiotis Sotiropoulos 2015-11-19 08:43:47 UTC
Closing as NOT A BUG, based on Comment 1.


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