We have two
JBoss instances running at the same time
(For ex:
App1.war running under %JBOSS_HOME%/server/JBoss_Instance1 and
App2.war running under %JBOSS_HOME%/server/JBoss_Instance2
on the
SAME machine)
Both these apps have their own LoggerClass to access Log4j instance. (We have this class in the workspace and at ANT-Build time this class goes into both the Apps' war). Structure of Class attached at the end.
Both Apps have their own ServletContextListeners which initializes their respective Loggerclasses at respective JBoss start up.
The problem is:
Both Apps creates/initializes their app.log files but only one of them succeeds in logging while other doesn't.
The way we access in our code where we need to log is -
SomeLogger logger = SomeLogger.getLogger();
/*some logic*/
logger.logInfo("ClassName.API","Log Message");
Workaround:
We created LoggerClass1 for App1 and LoggerClass2 for App2 (except different name for class, they both are identical)- Things worked awesome
Could there be a problem at the JBoss-Log4j configuration, that we are missing? Or does logging of apps in JBoss is handled at Container level rather than App level?
Any pointer or directions would be of great help.