Bug 1283194 - logViewer cannot show the log file generated by custom handler
logViewer cannot show the log file generated by custom handler
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Logging (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Panagiotis Sotiropoulos
Nikoleta Ziakova
Depends On:
  Show dependency treegraph
Reported: 2015-11-18 07:35 EST by Ranjith Pulluru
Modified: 2015-11-30 08:20 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-11-19 03:43:47 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ranjith Pulluru 2015-11-18 07:35:08 EST
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"/>
          <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
       <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"/>
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 15:47:08 EST
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:
Comment 2 Panagiotis Sotiropoulos 2015-11-19 03:43:47 EST
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.