0 Replies Latest reply on Apr 12, 2016 7:41 AM by Szymon Madej

    JBoss 7.1.1.Final - Multiple access logs.

    Szymon Madej Newbie



      I need multiple access logs from one JBoss 7.1.1.Final instance. One for common logging and second for SIEM which requires very specific log pattern.


      In previous JBoss i.e. 4.2.3.GA I just simply edited configuration of embedded Tomcat in file jboss-4.2.3.GA/server/default/deploy/jboss-web.deployer/server.xml and added two separate valves with className="org.apache.catalina.valves.AccessLogValve" and everything was working fine.


      But in 7.1.1.Final there is no server.xml and access logs configuration is contained in jboss-as-7.1.1.Final/standalone/configuration/standalone.xml in subsystem xmlns="urn:jboss:domain:web:1.1". XMLSchema jboss-as-web_1_1.xsd defines access-log element as:

      <xs:element name="access-log" minOccurs="0" type="http-access-logType"/>

      what means that it can occur 0 or 1 time (maxOccurs is not specified so it defaults to 1).


      If I ignore XMLSchema and add two access-log sections, then I receive below error when starting JBoss:


      ERROR [org.jboss.as.controller.management-operation] Operation ("add") failed - address: ([

          ("subsystem" => "web"),

          ("virtual-server" => "default-host"),

          ("access-log" => "configuration")

      ]) - failure description: "JBAS014803: Duplicate resource [

          (\"subsystem\" => \"web\"),

          (\"virtual-server\" => \"default-host\"),

          (\"access-log\" => \"configuration\")



      So the question is, how in JBoss 7.1.1.Final I can create two access logs with different log patterns?

      It was possible in JBoss 4.2.3.GA but it looks like it is not possible in JBoss 7.1.1.Final. Even more it looks like it is not possible in WildFly 10 also, which is not using Tomcat anymore and switched to Undertow. Latest XMLSchema for Undertow wildfly-undertow_3_0.xsd defines access-log element as:

      <xs:element name="access-log" type="accessLogType" maxOccurs="1" minOccurs="0"/>

      what by definition is identical to access-log element in jboss-as-web_1_1.xsd


      Best regards