Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-474

Custom formatter property changes not written to, but overriden by logging.properties

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Logging
    • None
    • Hide
      1. Create custom formatter with properties.
        <custom-formatter class="my.Formatter" module="my.module">
        	<properties>
        		<property name="pattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] (%t) %s%E%n" />
        		<property name="dynamicProperty" value="${someSystemProperty}" />
        	</properties>
        </custom-formatter>
        
      2. Start server.
      3. Stop server.
      4. Change properties' values.
      5. Start server.
        Notice that:
      • logging.properties contain old values;
      • formatter class instance has old values.
      Show
      Create custom formatter with properties. <custom-formatter class= "my.Formatter" module= "my.module" > <properties> <property name= "pattern" value= "%d{HH:mm:ss,SSS} %-5p [%c{1}] (%t) %s%E%n" /> <property name= "dynamicProperty" value= "${someSystemProperty}" /> </properties> </custom-formatter> Start server. Stop server. Change properties' values. Start server. Notice that: logging.properties contain old values; formatter class instance has old values.
    • Hide

      Use the CLI write-attribute operation to write new properties.

      Show
      Use the CLI write-attribute operation to write new properties.

      When you first add custom formatter with properties to standalone.xml, on server start property values get correctly resolved and written to logging.properties.
      If you change property values in standalone.xml of an existing custom formatter, that was flushed to logging.properties before, then on the next server start new values don't get written to logging.properties and formatter instance gets the old values from logging.properties.

      For properties with static values that are defined in standalone.xml there is a workaround: change the custom formatter name each time you change a property value.
      But with more dynamic properties, e.g. that rely on system properties, it's not so simple...

              jperkins-rhn James Perkins
              vsevolodgol Vsevolod Golovanov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: