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: =================
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)
Closing as NOT A BUG, based on Comment 1.