User: user57 Date: 02/02/27 01:24:24 Modified: src/main/org/jboss/logging Logger.java Log: o Release structure and server config changes Revision Changes Path 1.2 +34 -7 jboss-common/src/main/org/jboss/logging/Logger.java Index: Logger.java =================================================================== RCS file: /cvsroot/jboss/jboss-common/src/main/org/jboss/logging/Logger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Logger.java 24 Feb 2002 10:16:52 -0000 1.1 +++ Logger.java 27 Feb 2002 09:24:24 -0000 1.2 @@ -13,31 +13,40 @@ import org.apache.log4j.Priority; /** - * A custom log4j Category wrapper that adds a trace level priority and only - * exposes the relevent factory and logging methods. + * A custom log4j Category wrapper that adds a trace level priority, + * is serializable and only exposes the relevent factory and logging + * methods. * * @see #isTraceEnabled - * @see #trace(Object message) - * @see #trace(Object, Throwable) + * @see #trace(Object) + * @see #trace(Object,Throwable) * + * @version <tt>$Revision: 1.2 $</tt> * @author [EMAIL PROTECTED] - * @version $Revision: 1.1 $ */ public class Logger + implements java.io.Serializable { + /** The category name. */ + private final String name; + /** The Log4j delegate logger. */ - private Category log; + private transient Category log; /** * Creates new JBossCategory with the given category name. * * @param name the category name. */ - protected Logger(String name) + protected Logger(final String name) { + this.name = name; log = Category.getInstance(name); } + /** + * Expose the raw category for this logger. + */ public Category getCategory() { return log; @@ -208,6 +217,24 @@ public void log(Priority p, Object message, Throwable t) { log.log(p, message, t); + } + + + ///////////////////////////////////////////////////////////////////////// + // Custom Serialization // + ///////////////////////////////////////////////////////////////////////// + + private void writeObject(java.io.ObjectOutputStream stream) + throws java.io.IOException + { + // nothing + } + + private void readObject(java.io.ObjectInputStream stream) + throws java.io.IOException, ClassNotFoundException + { + // Restore logging + log = Category.getInstance(name); }
_______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development