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

Element syslog-format should not be required

XMLWordPrintable

    • Hide

      1. Configure logging subsystem to use syslog-handler

                  <syslog-handler name="SYSLOG">
                      <server-address value="localhost"/>
                      <port value="514"/>
                      <app-name value="myApp"/>
                      <formatter>
                          <named-formatter name="PATTERN"/>
                      </formatter>
                  </syslog-handler>

      2. Start the server (standalone mode)

      3.You get a validation error as follows

      ERROR [org.jboss.as.controller] (Controller Boot Thread) 
      OPVDX001: Validation error in standalone-full.xml ------------------------------
      |
      |  139:     <port value="514"/>
      |  140:     <app-name value="myapp"/>
      |  141:     <formatter>
      |           ^^^^ 'formatter' is missing one or more required child elements
      |                
      |                All of the following are required: syslog_formatter 
      |
      |  142:         <named-formatter name="PATTERN"/>
      |  143:     </formatter>
      |  144: </syslog-handler>
      |
      | The primary underlying error message was:
      | > ParseError at [row,col]:[143,17]
      | > Message: WFLYCTL0134: Missing required element(s): SYSLOG_FORMATTER
      |
      |-------------------------------------------------------------------------------
      ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
          at org.jboss.as.controller@15.0.1.Final//org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)
          at org.jboss.as.server@15.0.1.Final//org.jboss.as.server.ServerService.boot(ServerService.java:403)
          at org.jboss.as.controller@15.0.1.Final//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)
          at java.base/java.lang.Thread.run(Thread.java:834)
      FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
      

      4. Stop server and change the syslog-handler config as follows

                  <syslog-handler name="SYSLOG">
                      <server-address value="localhost"/>
                      <port value="514"/>
                      <app-name value="myApp"/>
                      <formatter>
                          <syslog-format syslog-type="RFC5424"/>
                          <named-formatter name="PATTERN"/>
                      </formatter>
                  </syslog-handler>

      5. Restart the server and verify that validation error goes away

      Show
      1. Configure logging subsystem to use syslog-handler           <syslog-handler name= "SYSLOG" >                 <server-address value= "localhost" />                 <port value= "514" />                 <app-name value= "myApp" />                 <formatter>                     <named-formatter name= "PATTERN" />                 </formatter>             </syslog-handler> 2. Start the server (standalone mode) 3.You get a validation error as follows ERROR [org.jboss.as.controller] (Controller Boot Thread )  OPVDX001: Validation error in standalone-full.xml ------------------------------ | |  139:     <port value= "514" /> |  140:     <app-name value= "myapp" /> |  141:     <formatter> |           ^^^^ 'formatter' is missing one or more required child elements |                 |                All of the following are required: syslog_formatter  | |  142:         <named-formatter name= "PATTERN" /> |  143:     </formatter> |  144: </syslog-handler> | | The primary underlying error message was: | > ParseError at [row,col]:[143,17] | > Message: WFLYCTL0134: Missing required element(s): SYSLOG_FORMATTER | |------------------------------------------------------------------------------- ERROR [org.jboss.as.server] (Controller Boot Thread ) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration     at org.jboss.as.controller@15.0.1.Final //org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:143)     at org.jboss.as.server@15.0.1.Final //org.jboss.as.server.ServerService.boot(ServerService.java:403)     at org.jboss.as.controller@15.0.1.Final //org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:416)     at java.base/java.lang. Thread .run( Thread .java:834) FATAL [org.jboss.as.server] (Controller Boot Thread ) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details. 4. Stop server and change the syslog-handler config as follows             <syslog-handler name= "SYSLOG" >               <server-address value= "localhost" />                 <port value= "514" />                 <app-name value= "myApp" />                 <formatter>                     <syslog-format syslog-type= "RFC5424" />                     <named-formatter name= "PATTERN" />                 </formatter>           </syslog-handler> 5. Restart the server and verify that validation error goes away

      The element syslog-format used by syslog-handler in the logging subsystem should not be required. It defaults to RFC5424. Also, without that element xml validation fails (if you want to use a formatter).

      Suggested solution:

      The minimal fix would be to add minOccurs="0" for the syslog-format element in

      https://github.com/wildfly/wildfly-core/blob/main/logging/src/main/resources/schema/jboss-as-logging_8_0.xsd

              jperkins-rhn James Perkins
              modi.uday Uday Modi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: