logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <carn...@apache.org>
Subject Chainsaw dependencies on log4j 1.3
Date Tue, 10 Apr 2007 20:28:13 GMT
I did an experiment of building chainsaw against the current SVN for  
log4j 1.2 and have a rough analysis of the dependencies issues:


     [javac] Compiling 102 source files to /Users/curta/ls-svn/ 
chainsaw/build
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppender.java:23: cannot find symbol
     [javac] symbol  : class Constants
     [javac] location: package org.apache.log4j.helpers
     [javac] import org.apache.log4j.helpers.Constants;

This error occurs in several files where chainsaw attempts to access  
string constants APPLICATION_KEY, HOSTNAME_KEY and LOG4J_ID_KEY.  The  
easiest remedy would add these constants to ChainsawConstants.




     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:30: package  
org.apache.log4j.rule does not exist
     [javac] import org.apache.log4j.rule.ExpressionRule;
     [javac]                              ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:31: package  
org.apache.log4j.rule does not exist
     [javac] import org.apache.log4j.rule.Rule;


Chainsaw makes extension use of the org.apache.log4j.rule package  
that supports org.apache.log4j.filter.ExpressionFilter and  
org.apache.log4j.LocationInfoFilter.  Those filters may be useful to  
a log4j 1.2.x user, so it may be useful to backport them to be  
compatible with log4j 1.2.x and either incorporate them into log4j  
1.2.x or make them available an add-on for log4j 1.2.x.



     [javac]                              ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:33: cannot find symbol
     [javac] symbol  : class LoggerRepositoryEx
     [javac] location: package org.apache.log4j.spi
     [javac] import org.apache.log4j.spi.LoggerRepositoryEx;
     [javac]                             ^

The LoggerRepositoryEx interface added methods to monitor the  
addition of new loggers and appenders and several other functions.   
Will need to review how these are used.  If they are added, it would  
likely have to be implemented in log4j 1.2.x itself.


     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:29: cannot find symbol
     [javac] symbol  : class SocketReceiver
     [javac] location: package org.apache.log4j.net
     [javac] import org.apache.log4j.net.SocketReceiver;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/LogUI.java:107: cannot find symbol
     [javac] symbol  : class SocketNodeEventListener
     [javac] location: package org.apache.log4j.net
     [javac] import org.apache.log4j.net.SocketNodeEventListener;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:34: cannot find symbol
     [javac] symbol  : class LoggingEventFieldResolver
     [javac] location: package org.apache.log4j.spi
     [javac] import org.apache.log4j.spi.LoggingEventFieldResolver;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/ChainsawAppenderHandler.java:52: cannot find symbol
     [javac] symbol  : class LoggingEventFieldResolver
     [javac] location: class  
org.apache.log4j.chainsaw.ChainsawAppenderHandler
     [javac]   private final LoggingEventFieldResolver resolver =  
LoggingEventFieldResolver
     [javac]                 ^
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/receivers/PluginPropertyEditorPanel.java:54: cannot find symbol
     [javac] symbol  : class SocketHubReceiver
     [javac] location: package org.apache.log4j.net
     [javac] import org.apache.log4j.net.SocketHubReceiver;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/receivers/ReceiversPanel.java:71: cannot find symbol
     [javac] symbol  : class SocketNodeEventListener
     [javac] location: package org.apache.log4j.net
     [javac] import org.apache.log4j.net.SocketNodeEventListener;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/receivers/ReceiversPanel.java:72: cannot find symbol
     [javac] symbol  : class SocketReceiver
     [javac] location: package org.apache.log4j.net
     [javac] import org.apache.log4j.net.SocketReceiver;
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/receivers/ReceiversPanel.java:435: cannot find symbol
     [javac] symbol  : class Receiver
     [javac] location: class  
org.apache.log4j.chainsaw.receivers.ReceiversPanel
     [javac]   private Receiver getCurrentlySelectedReceiver() {
     [javac]           ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/FileMenu.java:41: cannot find symbol
     [javac] symbol  : class UtilLoggingXMLDecoder
     [javac] location: package org.apache.log4j.xml
     [javac] import org.apache.log4j.xml.UtilLoggingXMLDecoder;
     [javac]                             ^
     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/FileMenu.java:42: cannot find symbol
     [javac] symbol  : class XMLDecoder
     [javac] location: package org.apache.log4j.xml
     [javac] import org.apache.log4j.xml.XMLDecoder;
     [javac]                             ^

I'm guessing all the receiver stuff is unlikely to be used anywhere  
outside of Chainsaw.  However, it might still be useful to package  
them up as a distinct package.



     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/LogUI.java:106: package org.apache.log4j.joran does not exist
     [javac] import org.apache.log4j.joran.JoranConfigurator;
     [javac]                               ^

Likely could be changed back to DOMConfigurator.


     [javac] /Users/curta/ls-svn/chainsaw/src/java/org/apache/log4j/ 
chainsaw/LogUI.java:108: package org.apache.log4j.plugins does not exist
     [javac] import org.apache.log4j.plugins.Plugin;

Chainsaw uses the plugins package internally and they are also used  
in the log4j receivers.  I think it would probably be best to keep  
them with the receivers.

My suggestions would be to start two new sandbox projects, one for  
the rule filters and one for the receivers+plugin.  Alternately,  
rules could go into log4j 1.2 and receivers+plugin could go  
chainsaw.  Change the org.apache.log4j.spi.Constant references to  
org.apache.log4j.chainsaw.ChainsawConstant references and review the  
usage LoggerRepositoryEx and DOMConfigurator.

I've confirmed that log4j 1.2.x does serialize the MDC content, it is  
just that the log4j 1.3 deserialization doesn't pick it up.  Likely  
if Chainsaw was hosted in log4j 1.2, the MDC content would show up  
for log4j 1.2 clients and disappear for log4j 1.3 clients.  I think  
it is possible that you might be able to write a custom serialization  
that could read both log4j 1.2 and log4j 1.3 serialization.  I'm  
skeptical that it could be done with default serialization.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message