cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger LoggerBase.java
yoavs 2004/05/26 08:48:29 Modified:catalina/src/share/org/apache/catalina/logger LoggerBase.java Log: Minor JavaDoc fixes (Bugzilla 28335) Revision ChangesPath 1.9 +3 -3 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java Index: LoggerBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- LoggerBase.java 27 Feb 2004 14:58:44 - 1.8 +++ LoggerBase.java 26 May 2004 15:48:29 - 1.9 @@ -185,7 +185,7 @@ * Set the verbosity level of this logger. Messages logged with a * higher verbosity than this level will be silently ignored. * - * @param verbosityLevel The new verbosity level, as a string + * @param verbosity The new verbosity level, as a string */ public void setVerbosityLevel(String verbosity) { @@ -223,7 +223,7 @@ * log. The name and type of the servlet log is specific to the * servlet container. This message will be logged unconditionally. * - * @param message A String specifying the message to be + * @param msg A String specifying the message to be * written to the log file */ public void log(String msg) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger LoggerBase.java
amyroh 2003/09/27 17:43:28 Modified:catalina/src/share/org/apache/catalina/logger LoggerBase.java Log: Remove debugging logs. Revision ChangesPath 1.6 +4 -6 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java Index: LoggerBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- LoggerBase.java 2 Sep 2003 21:22:06 - 1.5 +++ LoggerBase.java 28 Sep 2003 00:43:28 - 1.6 @@ -406,7 +406,6 @@ domain=name.getDomain(); host=name.getKeyProperty("host"); path=name.getKeyProperty("path"); -log("preRegister with "+name); if( container== null ) { // Register with the parent try { @@ -450,7 +449,6 @@ } public ObjectName createObjectName() { -log("createObjectName with "+container); // register try { StandardEngine engine=null; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger LoggerBase.java
- Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, March 18, 2003 11:27 PM Subject: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger LoggerBase.java > costin 2003/03/18 23:27:57 > > Modified:catalina/src/share/org/apache/catalina/logger > LoggerBase.java > Log: > Registration for loggers. > > We do need to make a final decision about this. I didn't get any feedback on the > logger names used in context ( with the context path as prefix of the logger name ). > IMO the logging in tomcat should be delegated via commons-logging to an external > implementation - either jdk1.4 logging or log4j. > > We do need to decide on the names of the loggers and provide some default > configs, and eventually start bundling log4j or config files for jdk1.4 ( or > both ). If we do that, LoggerBase and all other classes will remain only > for backward compatibility. > +1, but we need to at least support Ceki's proposal to split web-app logging by ContextClassLoader. Easy enough to do in 3.3.2-dev (yes, well, it's still on my plate :), and should be almost as easy in 5.x. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger LoggerBase.java
costin 2003/03/18 23:27:57 Modified:catalina/src/share/org/apache/catalina/logger LoggerBase.java Log: Registration for loggers. We do need to make a final decision about this. I didn't get any feedback on the logger names used in context ( with the context path as prefix of the logger name ). IMO the logging in tomcat should be delegated via commons-logging to an external implementation - either jdk1.4 logging or log4j. We do need to decide on the names of the loggers and provide some default configs, and eventually start bundling log4j or config files for jdk1.4 ( or both ). If we do that, LoggerBase and all other classes will remain only for backward compatibility. Revision ChangesPath 1.2 +123 -9 jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java Index: LoggerBase.java === RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/logger/LoggerBase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LoggerBase.java 18 Jul 2002 16:48:01 - 1.1 +++ LoggerBase.java 19 Mar 2003 07:27:57 - 1.2 @@ -69,10 +69,20 @@ import java.beans.PropertyChangeListener; import java.io.CharArrayWriter; import java.io.PrintWriter; +import java.util.Set; import javax.servlet.ServletException; +import javax.management.ObjectName; +import javax.management.MBeanServer; +import javax.management.MBeanRegistration; import org.apache.catalina.Container; import org.apache.catalina.LifecycleException; import org.apache.catalina.Logger; +import org.apache.catalina.Lifecycle; +import org.apache.catalina.core.StandardEngine; +import org.apache.catalina.core.StandardHost; +import org.apache.catalina.core.StandardContext; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** @@ -84,10 +94,11 @@ * @version $Revision$ $Date$ */ -public abstract class LoggerBase -implements Logger { - - +public class LoggerBase +implements Logger, MBeanRegistration + { +private static Log log = LogFactory.getLog(LoggerBase.class); + // - Instance Variables @@ -252,7 +263,9 @@ * @param message A String specifying the message to be * written to the log file */ -public abstract void log(String msg); +public void log(String msg) { +log.info(msg); +} /** @@ -349,5 +362,106 @@ } +protected String domain; +protected String host; +protected String path; +protected ObjectName oname; +protected ObjectName controller; +protected MBeanServer mserver; + +public ObjectName getController() { +return controller; +} + +public void setController(ObjectName controller) { +this.controller = controller; +} + +public ObjectName getObjectName() { +return oname; +} + +public String getDomain() { +return domain; +} + +public ObjectName preRegister(MBeanServer server, + ObjectName name) throws Exception { +oname=name; +mserver=server; +domain=name.getDomain(); + +host=name.getKeyProperty("host"); +path=name.getKeyProperty("path"); + +if( container== null ) { +// Register with the parent +try { +ObjectName cname=null; +if( host == null ) { +// global +cname=new ObjectName(domain +":type=Engine"); +} else if( path==null ) { +cname=new ObjectName(domain + +":type=Host,host=" + host); +} else { +cname=new ObjectName(domain +":j2eeType=WebModule,name=//" + +host + "/" + path); +} +log.info("Register with " + cname); +mserver.invoke(cname, "setLogger", new Object[] {this}, +new String[] {"org.apache.catalina.Logger"}); +} catch (Exception e) { +e.printStackTrace(); //To change body of catch statement use Options | File Templates. +} +} + +return name; +} + +public void postRegister(Boolean registrationDone) { +} + +public void preDeregister() throws Exception { +} +public void postDeregister() { +} + +public void init() { + +} + +public void destroy() { + +} + +public ObjectName