Log4j properties not updating ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, January 16, 2003 03:58 AM

Hey, I have to Log4j installed and logging in a legacy servlet enviroment. I am using Iplanet 6.0 without WEB-apps I have added the following to the servlet.properties. servlet.Log4jInit.code=ie.log4j.Log4jInit servlet.Log4jInit.context=global servlet.Log4jInit.initArgs=log4j.configuration=log4j.properties servlet.Log4jInit.startup=true I am using a "hacked" sample of the properties log4j.rootLogger=debug, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=/tmp/example.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.Ma   More>>

Hey,


I have to Log4j installed and logging in a legacy servlet enviroment. I am using Iplanet 6.0 without WEB-apps


I have added the following to the servlet.properties.

			
servlet.Log4jInit.code=ie.log4j.Log4jInit
servlet.Log4jInit.context=global
servlet.Log4jInit.initArgs=log4j.configuration=log4j.properties
servlet.Log4jInit.startup=true


I am using a "hacked" sample of the properties

			
log4j.rootLogger=debug, R

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=/tmp/example.log

log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


And a jsp to call the Logger

			
<%@ page import="org.apache.log4j.Logger,org.apache.log4j.Level" %>
<%
Logger logger = Logger.getLogger("R");
logger.info("R info");
logger.warn("R warn");
logger.debug("R debug");
logger.error("R error");
logger.fatal("R fatal");
%>
Attempting to log ?


My problem is that any changes I make to the log4j.properties are only reflected when I restart the server ? Does anyone know how to get changes reflected at runtime ?

thanks

Eoin

   <<Less

Re: Log4j properties not updating ?

Posted By:   Adrian_K  
Posted On:   Thursday, January 16, 2003 04:37 AM

This a sample, you have to read the log4j API in order to see all the possible changes you can do at runtime:


Logger logger = Logger.getLogger("myThread");
Level level = Level.toLevel(minLevel, Level.toLevel("INFO"));
logger.setLevel(level);
About | Sitemap | Contact