Hi all,

I've used log4j with Jboss for ages and it works really well. Now I'm
trying to port my app to Orion and I realise that I have to initialize
log4j and setup the log4j properties file myself. 

I've read the docs and I'm trying to do it using an initialization
servlet.

Here's the bones of the code:

public class Init implements ServletContextListener {
    private static Logger log = Logger.getLogger( Init.class);
    private Configuration config;


    public void contextDestroyed(ServletContextEvent sce) {
        log.info("notification that the web app is stopping");
    }
    
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("notification that the web app is started");
          config = Configuration.getInstance();
          initializeLog4j();    
    }

        private void initializeLog4j(){
                String pathToLog4jFile = config.getPathToLog4jProps();
                if (pathToLog4jFile == null) { 
                        System.err.println("Log4j properties file not
found");
                        System.err.println("Log4J cannot be
initialized."); 
                } else {
                        PropertyConfigurator.configure(pathToLog4jFile);
                }
        }
}

Now, I presume I then have to put a basic log4j.properties file on the
defined path above and away we go. However, when I put the log4j
properties file in the /orion/lib folder along with the jar itself I get
a nasty startup error. If anyone is successfully using log4j with orion
I could really do with a hand.

Thanks so much,
Brian



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to