Thanks for replying James.We tried two approaches-1. We excluded logging subsystem from deployment with a jboss-deployment-structure.xml and added log4j2 dependency (by adding module and jar in Jboss And also tried adding in WAR). It still picks log format defined in standalone.xml
2. We removed logging subsystem from the Standalone.xml itself and provided log4j2 jar and log4j2.xml in WAR. - This way it started picking log4j2. But now the problem is that its writing to previous day file only and current day file is written as per logging.properties(that comes with Jboss) format. Below is how our RollingFileAppender is configured<RollingFile name="LogFileAppender"
fileName="${logsfileLocation}/server.log"
filePattern="${logsfileLocation}/server.log.%d{yyyy-MM-dd}">
<PatternLayout>
<Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
</PatternLayout>
<Policies>
<OnStartupTriggeringPolicy minSize="0"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<LevelRangeFilter minLevel="ERROR" maxLevel="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</RollingFile>
On Wednesday, January 26, 2022 at 10:27:53 PM UTC-8 harry...@gmail.com wrote:Thanks for replying James.We tried two approaches-1. We excluded logging subsystem from deployment with a jboss-deployment-structure.xml and added log4j2 dependency (by adding module and jar in Jboss And also tried adding in WAR). It still picks log format defined in standalone.xmlWhat do you mean by "adding a module"? Do you mean you created something like a org.apache.logging.log4j module? If so you'd need to likely add some system properties as to where to find the configuration file. I'd suggest including the configuration file and libraries in your WAR itself.
2. We removed logging subsystem from the Standalone.xml itself and provided log4j2 jar and log4j2.xml in WAR. - This way it started picking log4j2. But now the problem is that its writing to previous day file only and current day file is written as per logging.properties(that comes with Jboss) format. Below is how our RollingFileAppender is configured<RollingFile name="LogFileAppender"
fileName="${logsfileLocation}/server.log"
filePattern="${logsfileLocation}/server.log.%d{yyyy-MM-dd}">
<PatternLayout>
<Pattern>%d %-5p [%c] (%t) %m%n</Pattern>
</PatternLayout>
<Policies>
<OnStartupTriggeringPolicy minSize="0"/>
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
</Policies>
<LevelRangeFilter minLevel="ERROR" maxLevel="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
</RollingFile>I wouldn't suggest removing the logging subsystem. Log messages from the server will not be configurable at runtime and would require manual changes to the logging.properties file.
On Wednesday, 26 January 2022 at 21:16:03 UTC+5:30 jper...@redhat.com wrote:How did you disable the logging subsystem? If you exclude the org.apache.log4j module or the logging subsystem from your deployment with a jboss-deployment-structure.xml it should work. You also need to include log4j 2 as well.On Wednesday, January 26, 2022 at 6:53:55 AM UTC-8 harry...@gmail.com wrote:We are trying to use log4j2 with JBoss Eap 6.4 but seems JBOSS is giving priority to log4j1 that comes with it.What we tried is that we disabled logging subsystem from JBoss and provided log4j2 jar and configuration through the deployment war.When we tried this on WildFly 8.2 on the dev machine, we saw this working but as soon we moved to JBoss EAP 6.4 there we noticed log4j1.x (using OOB logging.properties) is writing to server.log instead and log4j2 is writing to previous day file.Please provide some guidance if anyone has tried this already.
--
You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/g1k7dDT1NG0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/8cfb2084-bcdf-49c9-9d3c-5b6f8d88f736n%40googlegroups.com.