Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Apply a JUL log Handler to only one web app?

Hi, 

I install a custom java.util.logging Handler for my app in a `ServletContextListener.contextInitialized`:
 
    Logger.getLogger("").addHandler(new MyLogHandler()) 

The problem is that MyLogHandler gets log messages from other web apps. Is there a common way to deal with this? Or do people not usually separate their logs by application like this?

I'm thinking I'll use thread local variables so the handler can discover if it's in the dynamic scope of a request or web context. This may be tricky in some cases.

thanks,
Rob

Back to the top