| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Convenience class that performs custom Log4J initialization for web environments, supporting 2 init parameters at the servlet context level (i.e. context-param in web.xml):
Note: initLogging should be called before any other Spring activity (when using Log4J), to guarantee proper initialization before any Spring logging attempts.
Note: Sets the web app root system property, for "${key}" substitutions within log file locations in the Log4J config file. The default system property key is "webapp.root". Example, using context-param "webAppRootKey" = "demo.root": log4j.appender.myfile.File=${demo.root}/WEB-INF/demo.log
WARNING: Some containers like Tomcat do NOT keep system properties separate per web app. You have to use unique "webAppRootKey" context-params per web app then, to avoid clashes. Other containers like Resin do isolate each web app's system properties: Here you can use the default key (i.e. no "webAppRootKey" context-param at all) without worrying.
WARNING: The WAR file containing the web application needs to be expanded to allow for setting the web app root system property and for loading Log4J configuration from a custom location. This is by default not the case when a WAR file gets deployed to WebLogic, for example. Do not use this configurer respectively Log4jConfigListener or Log4jConfigServlet in such an environment!
| Field Summary | |
final static String | CONFIG_LOCATION_PARAMParameter specifying the location of the Log4J config file |
final static String | REFRESH_INTERVAL_PARAMParameter specifying the refresh interval for checking the Log4J config file |
| Method Summary | |
static void | initLogging(ServletContext servletContext) |
static void | shutdownLogging(ServletContext servletContext)Shutdown Log4J to release all file locks. |
| Field Detail |
public final static String CONFIG_LOCATION_PARAM
public final static String REFRESH_INTERVAL_PARAM
| Method Detail |
public static void initLogging(ServletContext servletContext)
public static void shutdownLogging(ServletContext servletContext)
| Association Links |
to Class java.lang.String
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||