Hi Marc,
I do all of my application (EAR) initialization via a class in a bundled
web application that implements ServletContextListener i.e.
/**
* @see javax.servlet.ServletContextListener#contextInitialized(
* javax.servlet.ServletContextEvent)
*/
public void contextInitialized(ServletContextEvent event) {
// Call a 'startup' EJB or setup logging and other things here...
}
I tend to have a SystemServiceBean EJB with a startupSystem() method
which will setup loggers for the EJB module, and different classes in
each top-level (web) module to setup their loggers (just in case our
deployment strategy changes and some of the modules are split out onto
different servers).
Cheers
Joe
> -----Original Message-----
> From: Marc Ende [mailto:mlists_at_e-beyond.de]
> Sent: Thursday, 19 July 2007 5:29 PM
> To: users_at_glassfish.dev.java.net
> Subject: Re: Logging in GF 2
>
> Hello Joe,
>
> thanks for the example.
>
> Shevland, Joe schrieb:
> > I use Commons Logging and underneath that just the JDK
> logging atm (I
> > also had problems with Log4J not releasing resources
> correctly, or me
> > not releasing resources correctly, one of them), and as
> part of system
> > startup also attach some of my own handlers so I can log to files
> > elsewhere. The GF ones I found too verbose and there's no way to
> > configure them afaik (thought I had a good sed/tail pipe
> working for a
> > while but ended up culling out too much); the log definition class
> > below just holds a logger name and file name pattern to
> use, and the
> > custom SystemLogFormatter just logs how I want it:
> >
> Can you give me a hint (to docu for example) where to
> register these handlers? Should I register them on
> "ear-start" or the whole "glassfish-system-startup"?
>
> yours
>
> Marc
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.