public class Log4jConfigurator extends Object implements javax.servlet.ServletContextListener
The name / path of the Log4j properties file is specified in a servlet
context init parameter log4j.configurationFile
.
Constructor and Description |
---|
Log4jConfigurator() |
Modifier and Type | Method and Description |
---|---|
void |
contextDestroyed(javax.servlet.ServletContextEvent sce)
Handler for servlet context shutdown events.
|
void |
contextInitialized(javax.servlet.ServletContextEvent sce)
Handler for servlet context startup events; configures Log4j using
the properties file specified in the servlet context parameter
log4j.configurationFile . |
public Log4jConfigurator()
public void contextInitialized(javax.servlet.ServletContextEvent sce)
log4j.configurationFile
.
The properties file location must be relative to the web
application directory, e.g. /WEB-INF/log4j.properties
.
Upon successful Log4j initialisation logs the event at INFO level.
contextInitialized
in interface javax.servlet.ServletContextListener
sce
- A servlet context event.public void contextDestroyed(javax.servlet.ServletContextEvent sce)
contextDestroyed
in interface javax.servlet.ServletContextListener
sce
- A servlet context event.Copyright © 2014 NimbusDS. All Rights Reserved.