Instead of using "log4j" as a hardcoded name, why not use a standard JNDI namespace and have different apps register with different values for that JNDI namespace? That's what the ContextJNDISelector does in the log4j-sandbox.
It looks up the context using...
Context ctx = new InitialContext(); loggingContextName = (String) ctx.lookup("java:comp/env/log4j/logging-context");
And apps set the following in their web.xml...
<env-entry> <description>JNDI logging context for this webapp</description> <env-entry-name>log4j/logging-context</env-entry-name> <env-entry-value>BarracudaMVC</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry>
Jake
At 10:01 AM 11/25/2003 +0100, you wrote:
Paul,
There can be as many MBean servers per application as you want. The application developer has two choices, using app server's own MBean server or instantiating another one. The app server's MBean server is shared between all applications, and the one created by the developer can be used only by its application.
Each option is feasible and has its advantages and its drawbacks. Using only one MBean server simplifies administration effort because you just have to connect your JMX console to one port. All MBeans registered in that server will be accessible, even MBeans that are bundled with the app server itself. Under some circumstances I suppose that MBean server federation under cluster environments is solved by application server. The main drawback is that MBeans should use different names (and maybe that you can see zombie MBeans if appication has ended and has not deregister its beans...)
Having one MBean server per application will isolate MBeans but on the other hand administrators will have to connect to one different port per application and will see only the MBeans that correspond to that application. Application Server clustering support wont work either (don´t know if this functionality is available now on any app server).
cheers
Since there could in theory be several JMX agents running within the same VM, and that there are also several log4j repositories, we might want to consider some sort way of allowing a client (as an example, the class that creates and starts a particular JMX agent) to register a particular MBeanServer with a particular log4j Repository, and the log4j repository communicates with this MBeanServer therein to register Loggers, appenders etc.).
Hope that makes sense. I think I just confused myself.
cheers,
Paul Smith
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]