Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-17125

Set properties for custom-handler

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • Logging
    • None
    • Set a Value
    • ---
    • ---

      Hi team,

      I recently try to add a custom-handler, and this custom-handler (CustomPeriodicRotatingFileHandler) extends PeriodicRotatingFileHandler. In this custom-handler, the feature changes look good. But one thing to note that, when jboss logging subsystem tries to compile the settings and overwrite all the settings into logging.properties, we found that there is no handler.<handler_name>.constructorProperties set for this custom-handler.

      For example, if we use a periodic-rotating-file-handler, it will auto generate a settings in logging.properties with "handler.FILE.constructorProperties=fileName,append".

      If it doesn't set constructorProperties, it will choose a constructor without any params, like following constructor:

      public CustomPeriodicRotatingFileHandler() {}

      But we hope it can use constructor

      public CustomPeriodicRotatingFileHandler(final String classname, final String format1, final String format2, final String relativeTo, final String path) {}

      I have specified these params in the PropertyType in standalone.xml, like following: <custom-handler name="FILE" module="com.app.infrastructure" class="com.app.infrastructure.logging.CustomPeriodicRotatingFileHandler"> <formatter> <named-formatter name="PATTERN"/> </formatter> <properties> <property name="classname" value="stdout"/> <property name="format1" value="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/> <property name="format2" value="%s%E%n"/> <property name="relativeTo" value="${jboss.server.log.dir}"/> <property name="path" value="app-server.log"/> <property name="suffix" value=".yyyy-MM-dd"/> <property name="append" value="true"/> <property name="autoFlush" value="true"/> </properties> </custom-handler>

      Also, I have added setter methods for these properties. How can I fix the issue?

              jperkins-rhn James Perkins
              doyle.llagas@macquarie.com Yasmin Hajamuhiyideen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: