Sorry for getting back late. Got little busy with our release schedules and tests. Followed your recommendations and saw good gains in performance numbers (Up to 20 % gain in performance, particularly TPS). Here is what I did as per your suggestion.
1) Started using Asynchronous Loggers.The following are the system properties used. RingBufferSize of 20480 gave me good performance improvement. Default size didn't give me good performance numbers. Due to time limits I didn't do much playing around with these numbers.
-DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -DAsyncLogger.RingBufferSize=20480 -Dlog4j2.status.entries=1
2) My log4j2.xml file is as follows.
<?xml version="1.0" encoding="UTF-8"?>
<RollingRandomAccessFile name="XXXX_LOG" fileName="/path/to/log/xxxx.log" filePattern="/path/to/log/xxx.log.%i" append="true" immediateFlush="true">
%-5p [%t]: [%c
] %m%n - %X
<SizeBasedTriggeringPolicy size="250 MB"/>
I think those two changes gave me what we need.
Now coming to the over all experience with LOG4J2, I feel it should have been better. Particularly in an application where we have all these open source components involved (Spring, CXF, Hibernate). I think these components are CORE for any open source, J2EE application. As Ralph pointed out, I am not sure if any of the components are still using Log4j 1 jars, which are loaded by JBoss parent class loader. I, probably not immediately ready, to experiment forcing JBoss to use Log4J2, due to project timelines.
Is there a way for me to figure out which Log4j (1.2 or 2.0) JARs are used by Spring and CXF with-in my application ?
I still have few more tests to conduct on our TEST environment. We probably do it tomorrow. I can give you confirmed feed back about the performance gains, after those tests.
Also, we deploy 2 WAR files to the server and I saw some of the logs are written to other WAR's log files. But I will confirm this behavior once I do more tests.
Though my experience of migrating to LOG4J2 is little bitter (I ended up rolling back my changes from code repository twice before, due to multiple reasons), the performance numbers, made me feel, it is worth going through the pains.
Again thanks for all your support and help.