[
http://jira.jboss.com/jira/browse/JBAS-1313?page=comments#action_12351337 ]
Cserveny Tamas commented on JBAS-1313:
--------------------------------------
Hi,
I've implemented this change request.
A notification is installed into all subdeployers (the listeners are dynamically
added/removed from/to the SubDeployers using the notifications from the MainDeployer).
It seeks META-INF/log4j.xml / .prop in the classpath (using localCl), and configure the
logger for the given deployment.
It uses ClassLoaders to track deployments. It needs no code changes in any of the existing
JBoss code. (Tested on 4.0.3, with EARs, WARs and spring deployer)
One problem though, in an EAR deployment all subdeployments receives the classloader thus,
one cannot create seperate logger for sub deployments. (eg. one for the whole EAR and a
seperate for the WAR inside) Or a logger in a subdeployment would be used for the whole
application.
That's why this service is limited for 'root' deployments only at the moment.
What's next?
Cheers,
Tamas
RepositorySelector should be integrated into JBoss Server
---------------------------------------------------------
Key: JBAS-1313
URL:
http://jira.jboss.com/jira/browse/JBAS-1313
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: JMX
Reporter: Stan Silvert
Assigned To: Stan Silvert
Priority: Minor
Fix For: JBossAS-4.2.0.CR1
Often, an application will want to have its own log4j configuration and have all log
messages generated go to an application-specific log file. Solutions to this problem are
documented on this wiki page:
http://www.jboss.org/wiki/Wiki.jsp?page=Logging
The log4j RepositorySelector provides a clean solution to this problem without any
special classloader settings. However, at the present time, a developer must create his
own version of a RepositorySelector and make sure his application initializes it properly.
This can be difficult to accomplish because the RepositorySelector feature is not well
known and takes time to understand. It can also be difficult to make sure that the
RepositorySelector is initialized before the application makes ANY call to
Logger.getLogger().
We can instead, provide a RepositorySelector implementation as part of the JBoss
Application server. If a deployer finds a log4j.xml file in the /META-INF direcotry (or
/WEB-INF for WARs) it would add an entry into the RepositorySelector for that application.
Then, logging from that application would use the custom log4j configuration.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira