You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Paul Smith <ps...@aconex.com> on 2007/04/19 05:39:50 UTC
Chainsaw & log4j 1.2 status
First time trying to startup Chainsaw with the new dependency:
Exception in thread "main" java.lang.NullPointerException
at org.apache.log4j.chainsaw.receivers.ReceiversPanel.<init>
(ReceiversPanel.java:395)
at org.apache.log4j.chainsaw.LogUI.setupReceiverPanel(LogUI.java:493)
at org.apache.log4j.chainsaw.LogUI.initGUI(LogUI.java:397)
at org.apache.log4j.chainsaw.LogUI.activateViewer(LogUI.java:610)
at org.apache.log4j.chainsaw.LogUI.createChainsawGUI(LogUI.java:339)
at org.apache.log4j.chainsaw.LogUI.main(LogUI.java:257)
This is because the LoggerRepository is not of type
LoggerRepositoryEx. Chainsaw makes extensive use of the
PluginRegistry, and right now we have no central place where it can
access a PluginRegistry.
What I'll do is create a PluginRegistry somewhere higher up, and hand
this down to the components that need that; bit more IoC like. I
wish I was more IoC aware earlier on.. :)
cheers,
Paul
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 18, 2007, at 11:05 PM, Paul Smith wrote:
>>
>> This is because the LoggerRepository is not of type
>> LoggerRepositoryEx. Chainsaw makes extensive use of the
>> PluginRegistry, and right now we have no central place where it
>> can access a PluginRegistry.
>>
>> What I'll do is create a PluginRegistry somewhere higher up, and
>> hand this down to the components that need that; bit more IoC
>> like. I wish I was more IoC aware earlier on.. :)
>>
>
> Hmm, I can see no other way around this than to create a copy of
> Hierarchy from log4 1.3, copy that into the component module, and
> setup a RepositorySelector during LogUI startup that causes the
> default LoggerRepository to become the new Hierarchy version.
> Given the naming conflict here, I would suggest we call it
> HierarchyEx .. ?
>
> Paul
>
Let me take a look at it tomorrow and see if I can come up with
something cleaner.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
1) Take the Chainsaw patch I sent earlier, apply to local working copy.
2) Get latest log4j 1.2 branch, 'ant jar' and copy the dist/lib/log4j-
*1.2.1.5.jar into chainsaw/lib
3) Get the apache-log4j-* extra modules and 'mvn install' them. Copy
the target/*.jar from each one into chainsaw/lib
The contents of the chainsaw/lib directory I have is:
Paul-Smiths-Computer:~ paulsmith$ ll /workspace/log4j-chainsaw/lib/
total 4688
drwxr-xr-x 14 paulsmit admin 476B Apr 23 15:44 .
drwxr-xr-x 32 paulsmit admin 1K Apr 23 15:45 ..
-rw-r--r-- 1 paulsmit admin 6K Nov 14 2005 .DS_Store
-rw-r--r-- 1 paulsmit admin 1009K Apr 17 15:07 ant-1.6.5.jar
-rw-r--r-- 1 paulsmit admin 50K Apr 26 10:40 apache-log4j-
component-0.1-SNAPSHOT.jar
-rw-r--r-- 1 paulsmit admin 38K Apr 17 15:03 apache-log4j-
expression-filter-0.1-SNAPSHOT.jar
-rw-r--r-- 1 paulsmit admin 47K Apr 26 10:41 apache-log4j-
filters-0.1-SNAPSHOT.jar
-rw-r--r-- 1 paulsmit admin 89K Apr 26 10:40 apache-log4j-
receivers-0.1-SNAPSHOT.jar
-rw-r--r-- 1 paulsmit admin 24K Jan 4 2006 commons-logging-
api.jar
-rw-r--r-- 1 paulsmit admin 303K Jan 4 2006 commons-vfs-1.0-
RC3.jar
-rw-r--r-- 1 paulsmit admin 69K Jan 4 2006 jakarta-
oro-2.0.6.jar
-rw-r--r-- 1 paulsmit admin 86K Jan 4 2006 jmdns.jar
-rw-r--r-- 1 paulsmit admin 336K Apr 26 10:42 log4j-1.2.15.jar
-rw-r--r-- 1 paulsmit admin 259K Jan 4 2006 xstream-1.1.2.jar
I think that's it.
Re: the other receivers, just check the new apache-log4j-receivers
module to see if they're there, they might not have been copied over.
Paul
On 26/04/2007, at 4:35 PM, Scott Deboy wrote:
> Are all of the new-with-1.3 appenders and receivers moved over?
> UDP and multicast appenders & receivers, xmlsocketreceiver, etc.
>
> Also, if Paul or Curt would provide instructions on how to set up
> what you guys have done, I'd love to take a crack at it.
>
>
>
> Scott Deboy
> COMOTIV SYSTEMS
> 111 SW Columbia Street Ste. 950
> Portland, OR 97201
>
> Telephone: 503.224.7496
> Cell: 503.997.1367
> Fax: 503.222.0185
>
> sdeboy@comotivsystems.com
>
> www.comotivsystems.com
>
>
>
> -----Original Message-----
> From: Paul Smith [mailto:psmith@aconex.com]
> Sent: Wed 4/25/2007 5:55 PM
> To: Log4J Developers List
> Subject: Re: Chainsaw & log4j 1.2 status
>
>
> On 22/04/2007, at 3:21 PM, Paul Smith wrote:
>
>>>
>>> I've committed a PluginConfigurator to both the component and
>>> log4j 1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>>>
>>
>> Thanks, I'll give that a crack and see what we get.
>
>
> Success!
>
> With the below diff, I am able to use the same configuration file
> we'd been using internally to attach to our QA box via
> SocketHubAppender/Receiver. This is using the latest 1.2.15 +
> component+receiver+expression-filter modules.
>
> On top of that, I see lovely juicy MDC values appearing as new
> columns in Chainsaw. w00t.
>
> Scott, what else do you think we need to consider before deciding on
> whether we bind Chainsaw to log4j 1.2 permanently (if at all)?
>
> Index: src/java/org/apache/log4j/chainsaw/LogUI.java
> ===================================================================
> --- src/java/org/apache/log4j/chainsaw/LogUI.java (revision
> 532553)
> +++ src/java/org/apache/log4j/chainsaw/LogUI.java (working copy)
> @@ -53,6 +53,7 @@
> import java.util.List;
> import java.util.Map;
> import java.util.Set;
> +
> import javax.swing.AbstractAction;
> import javax.swing.Action;
> import javax.swing.BorderFactory;
> @@ -83,10 +84,12 @@
> import javax.swing.event.EventListenerList;
> import javax.swing.event.HyperlinkEvent;
> import javax.swing.event.HyperlinkListener;
> +
> import org.apache.log4j.AppenderSkeleton;
> import org.apache.log4j.Level;
> import org.apache.log4j.LogManager;
> import org.apache.log4j.Logger;
> +import org.apache.log4j.LoggerRepositoryExImpl;
> import org.apache.log4j.chainsaw.dnd.FileDnDTarget;
> import org.apache.log4j.chainsaw.help.HelpManager;
> import org.apache.log4j.chainsaw.help.Tutorial;
> @@ -104,7 +107,6 @@
> import org.apache.log4j.chainsaw.receivers.ReceiversPanel;
> import org.apache.log4j.chainsaw.version.VersionManager;
> import org.apache.log4j.helpers.Constants;
> -import org.apache.log4j.joran.JoranConfigurator;
> import org.apache.log4j.net.SocketNodeEventListener;
> import org.apache.log4j.plugins.Plugin;
> import org.apache.log4j.plugins.PluginEvent;
> @@ -114,9 +116,12 @@
> import org.apache.log4j.rule.ExpressionRule;
> import org.apache.log4j.rule.Rule;
> import org.apache.log4j.spi.Decoder;
> -import org.apache.log4j.spi.LoggingEvent;
> import org.apache.log4j.spi.LoggerRepository;
> import org.apache.log4j.spi.LoggerRepositoryEx;
> +import org.apache.log4j.spi.LoggingEvent;
> +import org.apache.log4j.spi.RepositorySelector;
> +import org.apache.log4j.xml.DOMConfigurator;
> +import org.apache.log4j.xml.PluginConfigurator;
> import org.apache.log4j.xml.XMLDecoder;
> @@ -190,6 +195,10 @@
> */
> private EventListenerList shutdownListenerList = new
> EventListenerList();
> private WelcomePanel welcomePanel;
> +
> + private static final Object repositorySelectorGuard = new Object();
> + private static final LoggerRepositoryExImpl repositoryExImpl = new
> LoggerRepositoryExImpl(LogManager.getLoggerRepository());
> +
> private PluginRegistry pluginRegistry;
> /**
> @@ -245,9 +254,19 @@
> * @param args
> */
> public static void main(String[] args) {
> +
> if(OSXIntegration.IS_OSX) {
> System.setProperty("apple.laf.useScreenMenuBar", "true");
> }
> +
> +
> + LogManager.setRepositorySelector(new RepositorySelector() {
> +
> + public LoggerRepository getLoggerRepository() {
> + return repositoryExImpl;
> + }}, repositorySelectorGuard);
> +
> +
> ApplicationPreferenceModel model = new
> ApplicationPreferenceModel();
> SettingsManager.getInstance().configure(new
> ApplicationPreferenceModelSaver(model));
> @@ -298,6 +317,7 @@
> showSplash(logUI);
> }
> logUI.cyclicBufferSize = model.getCyclicBufferSize();
> + logUI.pluginRegistry = repositoryExImpl.getPluginRegistry();
> logUI.handler = new ChainsawAppenderHandler();
> logUI.handler.addEventBatchListener(logUI.new
> NewTabEventBatchReceiver());
> @@ -1889,8 +1909,7 @@
> try {
> // we temporarily swap the TCCL so that plugins can
> find resources
> Thread.currentThread().setContextClassLoader
> (classLoader);
> - JoranConfigurator jc = new JoranConfigurator();
> - jc.doConfigure(url, LogManager.getLoggerRepository());
> + PluginConfigurator.configure(url);
> }finally{
> // now switch it back...
> Thread.currentThread().setContextClassLoader
> (previousTCCL);
> Index: src/java/org/apache/log4j/chainsaw/layout/
> EventDetailLayout.java
> ===================================================================
> --- src/java/org/apache/log4j/chainsaw/layout/
> EventDetailLayout.java (revision 532553)
> +++ src/java/org/apache/log4j/chainsaw/layout/
> EventDetailLayout.java (working copy)
> @@ -191,16 +191,15 @@
> li = formatLocationInfo(event);
> }
> Hashtable properties = formatProperties(event);
> - LoggingEvent copy = new LoggingEvent();
> - copy.setLogger(logger);
> - copy.setTimeStamp(event.getTimeStamp());
> - copy.setLevel(event.getLevel());
> - copy.setThreadName(threadName);
> - copy.setMessage(msg);
> - copy.setNDC(ndc);
> - copy.setThrowableInformation(event.getThrowableInformation());
> - copy.setLocationInformation(li);
> - copy.setProperties(properties);
> + LoggingEvent copy = new LoggingEvent(null,
> + logger, event.getTimeStamp(),
> + event.getLevel(),
> + msg,
> + threadName,
> + event.getThrowableInformation(),
> + ndc,
> + li,
> + properties);
>
> return copy;
> }
> Index: src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
> ===================================================================
> --- src/java/org/apache/log4j/chainsaw/layout/
> LayoutEditorPane.java (revision 532553)
> +++ src/java/org/apache/log4j/chainsaw/layout/
> LayoutEditorPane.java (working copy)
> @@ -182,16 +182,16 @@
> ThrowableInformation tsr = new ThrowableInformation(new
> Exception());
> - event = new LoggingEvent();
> - event.setLogger(Logger.getLogger("com.mycompany.mylogger"));
> - event.setTimeStamp(new Date().getTime());
> - event.setLevel(org.apache.log4j.Level.DEBUG);
> - event.setThreadName("Thread-1");
> - event.setMessage("The quick brown fox jumped over the lazy dog");
> - event.setNDC("NDC string");
> - event.setThrowableInformation(tsr);
> - event.setLocationInformation(li);
> - event.setProperties(hashTable);
> + event = new LoggingEvent("org.apache.log4j.Logger",
> + Logger.getLogger("com.mycompany.mylogger"),
> + new Date().getTime(),
> + org.apache.log4j.Level.DEBUG,
> + "The quick brown fox jumped over the lazy dog",
> + "Thread-1",
> + tsr,
> + "NDC string",
> + li,
> + hashTable);
>
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
>
>
> <winmail.dat>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-dev-help@logging.apache.org
Paul Smith
Core Engineering Manager
Aconex
The easy way to save time and money on your project
696 Bourke Street, Melbourne,
VIC 3000, Australia
Tel: +61 3 9240 0200 Fax: +61 3 9240 0299
Email: psmith@aconex.com www.aconex.com
This email and any attachments are intended solely for the addressee.
The contents may be privileged, confidential and/or subject to
copyright or other applicable law. No confidentiality or privilege is
lost by an erroneous transmission. If you have received this e-mail
in error, please let us know by reply e-mail and delete or destroy
this mail and all copies. If you are not the intended recipient of
this message you must not disseminate, copy or take any action in
reliance on it. The sender takes no responsibility for the effect of
this message upon the recipient's computer system.
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
>
> o.a.l.db.DBAppender and o.a.l.varia.ListModelAppender are in apache-
> log4j-receivers though maybe that is not the best place and likely
> not tested.
>
DBAppender probably needs to be moved into either the 1.2 branch with
the other appenders, or into a new optional appenders module.
> The following packages and classes have not been ported:
>
>
> o.a.l.multiplex
I think we can pretty much drop the above. I started work on that,
but it got messy very quickly. I don't this we should do anything
for 1.2 here.
> o.a.l.net.MulticastAppender
> o.a.l.net.UDPAppender
> o.a.l.varia.ListAppender
> o.a.l.varia.SoundAppender
>
> I'm not that familiar with these appenders. If you have
> suggestions on how to organize them, I can set up the projects.
The first 2 are pretty important to some folks, and if we have the
matching Receiver, then that's no use without the appender. The
other 2 are useful utility functions for GUI based apps. I'd say if
we decide to have a optional-appenders module, they could go in there.
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 26, 2007, at 1:35 AM, Scott Deboy wrote:
> Are all of the new-with-1.3 appenders and receivers moved over?
> UDP and multicast appenders & receivers, xmlsocketreceiver, etc.
>
Moving all the 1.3 appenders over wasn't the intent, but seems we
have gotten reasonably close and know how to spin things out into
companions. I think all the receivers have been moved over in the
apache-log4j-receivers. I've done a quick survey and think the
following is reasonably accurate for the Appenders:
o.a.l.db.DBAppender and o.a.l.varia.ListModelAppender are in apache-
log4j-receivers though maybe that is not the best place and likely
not tested.
The following packages and classes have not been ported:
o.a.l.lbel
o.a.l.multiplex
o.a.l.net.MulticastAppender
o.a.l.net.UDPAppender
o.a.l.varia.ListAppender
o.a.l.varia.SoundAppender
I'm not that familiar with these appenders. If you have suggestions
on how to organize them, I can set up the projects.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
RE: Chainsaw & log4j 1.2 status
Posted by Scott Deboy <sd...@comotivsystems.com>.
Are all of the new-with-1.3 appenders and receivers moved over? UDP and multicast appenders & receivers, xmlsocketreceiver, etc.
Also, if Paul or Curt would provide instructions on how to set up what you guys have done, I'd love to take a crack at it.
Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR 97201
Telephone: 503.224.7496
Cell: 503.997.1367
Fax: 503.222.0185
sdeboy@comotivsystems.com
www.comotivsystems.com
-----Original Message-----
From: Paul Smith [mailto:psmith@aconex.com]
Sent: Wed 4/25/2007 5:55 PM
To: Log4J Developers List
Subject: Re: Chainsaw & log4j 1.2 status
On 22/04/2007, at 3:21 PM, Paul Smith wrote:
>>
>> I've committed a PluginConfigurator to both the component and
>> log4j 1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>>
>
> Thanks, I'll give that a crack and see what we get.
Success!
With the below diff, I am able to use the same configuration file
we'd been using internally to attach to our QA box via
SocketHubAppender/Receiver. This is using the latest 1.2.15 +
component+receiver+expression-filter modules.
On top of that, I see lovely juicy MDC values appearing as new
columns in Chainsaw. w00t.
Scott, what else do you think we need to consider before deciding on
whether we bind Chainsaw to log4j 1.2 permanently (if at all)?
Index: src/java/org/apache/log4j/chainsaw/LogUI.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/LogUI.java (revision
532553)
+++ src/java/org/apache/log4j/chainsaw/LogUI.java (working copy)
@@ -53,6 +53,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
@@ -83,10 +84,12 @@
import javax.swing.event.EventListenerList;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
+import org.apache.log4j.LoggerRepositoryExImpl;
import org.apache.log4j.chainsaw.dnd.FileDnDTarget;
import org.apache.log4j.chainsaw.help.HelpManager;
import org.apache.log4j.chainsaw.help.Tutorial;
@@ -104,7 +107,6 @@
import org.apache.log4j.chainsaw.receivers.ReceiversPanel;
import org.apache.log4j.chainsaw.version.VersionManager;
import org.apache.log4j.helpers.Constants;
-import org.apache.log4j.joran.JoranConfigurator;
import org.apache.log4j.net.SocketNodeEventListener;
import org.apache.log4j.plugins.Plugin;
import org.apache.log4j.plugins.PluginEvent;
@@ -114,9 +116,12 @@
import org.apache.log4j.rule.ExpressionRule;
import org.apache.log4j.rule.Rule;
import org.apache.log4j.spi.Decoder;
-import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.spi.LoggerRepositoryEx;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.spi.RepositorySelector;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.log4j.xml.PluginConfigurator;
import org.apache.log4j.xml.XMLDecoder;
@@ -190,6 +195,10 @@
*/
private EventListenerList shutdownListenerList = new
EventListenerList();
private WelcomePanel welcomePanel;
+
+ private static final Object repositorySelectorGuard = new Object();
+ private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());
+
private PluginRegistry pluginRegistry;
/**
@@ -245,9 +254,19 @@
* @param args
*/
public static void main(String[] args) {
+
if(OSXIntegration.IS_OSX) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
+
+
+ LogManager.setRepositorySelector(new RepositorySelector() {
+
+ public LoggerRepository getLoggerRepository() {
+ return repositoryExImpl;
+ }}, repositorySelectorGuard);
+
+
ApplicationPreferenceModel model = new
ApplicationPreferenceModel();
SettingsManager.getInstance().configure(new
ApplicationPreferenceModelSaver(model));
@@ -298,6 +317,7 @@
showSplash(logUI);
}
logUI.cyclicBufferSize = model.getCyclicBufferSize();
+ logUI.pluginRegistry = repositoryExImpl.getPluginRegistry();
logUI.handler = new ChainsawAppenderHandler();
logUI.handler.addEventBatchListener(logUI.new
NewTabEventBatchReceiver());
@@ -1889,8 +1909,7 @@
try {
// we temporarily swap the TCCL so that plugins can
find resources
Thread.currentThread().setContextClassLoader
(classLoader);
- JoranConfigurator jc = new JoranConfigurator();
- jc.doConfigure(url, LogManager.getLoggerRepository());
+ PluginConfigurator.configure(url);
}finally{
// now switch it back...
Thread.currentThread().setContextClassLoader
(previousTCCL);
Index: src/java/org/apache/log4j/chainsaw/layout/EventDetailLayout.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (working copy)
@@ -191,16 +191,15 @@
li = formatLocationInfo(event);
}
Hashtable properties = formatProperties(event);
- LoggingEvent copy = new LoggingEvent();
- copy.setLogger(logger);
- copy.setTimeStamp(event.getTimeStamp());
- copy.setLevel(event.getLevel());
- copy.setThreadName(threadName);
- copy.setMessage(msg);
- copy.setNDC(ndc);
- copy.setThrowableInformation(event.getThrowableInformation());
- copy.setLocationInformation(li);
- copy.setProperties(properties);
+ LoggingEvent copy = new LoggingEvent(null,
+ logger, event.getTimeStamp(),
+ event.getLevel(),
+ msg,
+ threadName,
+ event.getThrowableInformation(),
+ ndc,
+ li,
+ properties);
return copy;
}
Index: src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (working copy)
@@ -182,16 +182,16 @@
ThrowableInformation tsr = new ThrowableInformation(new
Exception());
- event = new LoggingEvent();
- event.setLogger(Logger.getLogger("com.mycompany.mylogger"));
- event.setTimeStamp(new Date().getTime());
- event.setLevel(org.apache.log4j.Level.DEBUG);
- event.setThreadName("Thread-1");
- event.setMessage("The quick brown fox jumped over the lazy dog");
- event.setNDC("NDC string");
- event.setThrowableInformation(tsr);
- event.setLocationInformation(li);
- event.setProperties(hashTable);
+ event = new LoggingEvent("org.apache.log4j.Logger",
+ Logger.getLogger("com.mycompany.mylogger"),
+ new Date().getTime(),
+ org.apache.log4j.Level.DEBUG,
+ "The quick brown fox jumped over the lazy dog",
+ "Thread-1",
+ tsr,
+ "NDC string",
+ li,
+ hashTable);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 25, 2007, at 10:46 PM, Curt Arnold wrote:
>
>
> I should be able to kill the need for PluginConfigurator in just a
> few minutes.
>
Hope it is all there now. As long as you update log4j and update
components and use a repository selector, DOMConfigurator should
process plugin elements. For cases where you want to use plugin on
log4j's prior to 1.2.15, PluginConfigurator is still available (now
in o.a.l.plugins), but it shouldn't be necessary for chainsaw.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 25, 2007, at 8:24 PM, Paul Smith wrote:
>
> On 26/04/2007, at 11:00 AM, Scott Deboy wrote:
>
>> Full speed ahead!
>>
>> You mean we may get an official release out the door with
>> Chainsaw? I
>> started it when my first child was born. He's 4 now! (and I have 2
>> others)
>
> You're well on your way to breading an extended log4j-dev team then!
>
> What I'll do is whip up a bundle of deployments, and set them up
> alongside the current releases. I can do a webstart and zip
> bundle, and provide the links so that others can help with a QA
> cycle to truly verify we haven't done something wacky. If that
> passes, then we can vote on updating the current 'release' for
> mainstream users.
>
> Paul
>
I should be able to kill the need for PluginConfigurator in just a
few minutes.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
On 26/04/2007, at 11:00 AM, Scott Deboy wrote:
> Full speed ahead!
>
> You mean we may get an official release out the door with Chainsaw? I
> started it when my first child was born. He's 4 now! (and I have 2
> others)
You're well on your way to breading an extended log4j-dev team then!
What I'll do is whip up a bundle of deployments, and set them up
alongside the current releases. I can do a webstart and zip bundle,
and provide the links so that others can help with a QA cycle to
truly verify we haven't done something wacky. If that passes, then
we can vote on updating the current 'release' for mainstream users.
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
RE: Chainsaw & log4j 1.2 status
Posted by Scott Deboy <sd...@comotivsystems.com>.
Full speed ahead!
You mean we may get an official release out the door with Chainsaw? I
started it when my first child was born. He's 4 now! (and I have 2
others)
Scott Deboy
Principal Engineer
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR 97201
Office: 503.224.7496
Direct Line: 503.821.6482
Cell: 503.997.1367
Fax: 503.222.0185
sdeboy@comotivsystems.com
www.comotivsystems.com
-----Original Message-----
From: Paul Smith [mailto:psmith@aconex.com]
Sent: Wednesday, April 25, 2007 5:55 PM
To: Log4J Developers List
Subject: Re: Chainsaw & log4j 1.2 status
On 22/04/2007, at 3:21 PM, Paul Smith wrote:
>>
>> I've committed a PluginConfigurator to both the component and
>> log4j 1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>>
>
> Thanks, I'll give that a crack and see what we get.
Success!
With the below diff, I am able to use the same configuration file
we'd been using internally to attach to our QA box via
SocketHubAppender/Receiver. This is using the latest 1.2.15 +
component+receiver+expression-filter modules.
On top of that, I see lovely juicy MDC values appearing as new
columns in Chainsaw. w00t.
Scott, what else do you think we need to consider before deciding on
whether we bind Chainsaw to log4j 1.2 permanently (if at all)?
Index: src/java/org/apache/log4j/chainsaw/LogUI.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/LogUI.java (revision
532553)
+++ src/java/org/apache/log4j/chainsaw/LogUI.java (working copy)
@@ -53,6 +53,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
@@ -83,10 +84,12 @@
import javax.swing.event.EventListenerList;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
+import org.apache.log4j.LoggerRepositoryExImpl;
import org.apache.log4j.chainsaw.dnd.FileDnDTarget;
import org.apache.log4j.chainsaw.help.HelpManager;
import org.apache.log4j.chainsaw.help.Tutorial;
@@ -104,7 +107,6 @@
import org.apache.log4j.chainsaw.receivers.ReceiversPanel;
import org.apache.log4j.chainsaw.version.VersionManager;
import org.apache.log4j.helpers.Constants;
-import org.apache.log4j.joran.JoranConfigurator;
import org.apache.log4j.net.SocketNodeEventListener;
import org.apache.log4j.plugins.Plugin;
import org.apache.log4j.plugins.PluginEvent;
@@ -114,9 +116,12 @@
import org.apache.log4j.rule.ExpressionRule;
import org.apache.log4j.rule.Rule;
import org.apache.log4j.spi.Decoder;
-import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.spi.LoggerRepositoryEx;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.spi.RepositorySelector;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.log4j.xml.PluginConfigurator;
import org.apache.log4j.xml.XMLDecoder;
@@ -190,6 +195,10 @@
*/
private EventListenerList shutdownListenerList = new
EventListenerList();
private WelcomePanel welcomePanel;
+
+ private static final Object repositorySelectorGuard = new Object();
+ private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());
+
private PluginRegistry pluginRegistry;
/**
@@ -245,9 +254,19 @@
* @param args
*/
public static void main(String[] args) {
+
if(OSXIntegration.IS_OSX) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
+
+
+ LogManager.setRepositorySelector(new RepositorySelector() {
+
+ public LoggerRepository getLoggerRepository() {
+ return repositoryExImpl;
+ }}, repositorySelectorGuard);
+
+
ApplicationPreferenceModel model = new
ApplicationPreferenceModel();
SettingsManager.getInstance().configure(new
ApplicationPreferenceModelSaver(model));
@@ -298,6 +317,7 @@
showSplash(logUI);
}
logUI.cyclicBufferSize = model.getCyclicBufferSize();
+ logUI.pluginRegistry = repositoryExImpl.getPluginRegistry();
logUI.handler = new ChainsawAppenderHandler();
logUI.handler.addEventBatchListener(logUI.new
NewTabEventBatchReceiver());
@@ -1889,8 +1909,7 @@
try {
// we temporarily swap the TCCL so that plugins can
find resources
Thread.currentThread().setContextClassLoader
(classLoader);
- JoranConfigurator jc = new JoranConfigurator();
- jc.doConfigure(url, LogManager.getLoggerRepository());
+ PluginConfigurator.configure(url);
}finally{
// now switch it back...
Thread.currentThread().setContextClassLoader
(previousTCCL);
Index: src/java/org/apache/log4j/chainsaw/layout/EventDetailLayout.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (working copy)
@@ -191,16 +191,15 @@
li = formatLocationInfo(event);
}
Hashtable properties = formatProperties(event);
- LoggingEvent copy = new LoggingEvent();
- copy.setLogger(logger);
- copy.setTimeStamp(event.getTimeStamp());
- copy.setLevel(event.getLevel());
- copy.setThreadName(threadName);
- copy.setMessage(msg);
- copy.setNDC(ndc);
- copy.setThrowableInformation(event.getThrowableInformation());
- copy.setLocationInformation(li);
- copy.setProperties(properties);
+ LoggingEvent copy = new LoggingEvent(null,
+ logger, event.getTimeStamp(),
+ event.getLevel(),
+ msg,
+ threadName,
+ event.getThrowableInformation(),
+ ndc,
+ li,
+ properties);
return copy;
}
Index: src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (working copy)
@@ -182,16 +182,16 @@
ThrowableInformation tsr = new ThrowableInformation(new
Exception());
- event = new LoggingEvent();
- event.setLogger(Logger.getLogger("com.mycompany.mylogger"));
- event.setTimeStamp(new Date().getTime());
- event.setLevel(org.apache.log4j.Level.DEBUG);
- event.setThreadName("Thread-1");
- event.setMessage("The quick brown fox jumped over the lazy dog");
- event.setNDC("NDC string");
- event.setThrowableInformation(tsr);
- event.setLocationInformation(li);
- event.setProperties(hashTable);
+ event = new LoggingEvent("org.apache.log4j.Logger",
+ Logger.getLogger("com.mycompany.mylogger"),
+ new Date().getTime(),
+ org.apache.log4j.Level.DEBUG,
+ "The quick brown fox jumped over the lazy dog",
+ "Thread-1",
+ tsr,
+ "NDC string",
+ li,
+ hashTable);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
On 22/04/2007, at 3:21 PM, Paul Smith wrote:
>>
>> I've committed a PluginConfigurator to both the component and
>> log4j 1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>>
>
> Thanks, I'll give that a crack and see what we get.
Success!
With the below diff, I am able to use the same configuration file
we'd been using internally to attach to our QA box via
SocketHubAppender/Receiver. This is using the latest 1.2.15 +
component+receiver+expression-filter modules.
On top of that, I see lovely juicy MDC values appearing as new
columns in Chainsaw. w00t.
Scott, what else do you think we need to consider before deciding on
whether we bind Chainsaw to log4j 1.2 permanently (if at all)?
Index: src/java/org/apache/log4j/chainsaw/LogUI.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/LogUI.java (revision
532553)
+++ src/java/org/apache/log4j/chainsaw/LogUI.java (working copy)
@@ -53,6 +53,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.BorderFactory;
@@ -83,10 +84,12 @@
import javax.swing.event.EventListenerList;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
+
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
+import org.apache.log4j.LoggerRepositoryExImpl;
import org.apache.log4j.chainsaw.dnd.FileDnDTarget;
import org.apache.log4j.chainsaw.help.HelpManager;
import org.apache.log4j.chainsaw.help.Tutorial;
@@ -104,7 +107,6 @@
import org.apache.log4j.chainsaw.receivers.ReceiversPanel;
import org.apache.log4j.chainsaw.version.VersionManager;
import org.apache.log4j.helpers.Constants;
-import org.apache.log4j.joran.JoranConfigurator;
import org.apache.log4j.net.SocketNodeEventListener;
import org.apache.log4j.plugins.Plugin;
import org.apache.log4j.plugins.PluginEvent;
@@ -114,9 +116,12 @@
import org.apache.log4j.rule.ExpressionRule;
import org.apache.log4j.rule.Rule;
import org.apache.log4j.spi.Decoder;
-import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.log4j.spi.LoggerRepositoryEx;
+import org.apache.log4j.spi.LoggingEvent;
+import org.apache.log4j.spi.RepositorySelector;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.apache.log4j.xml.PluginConfigurator;
import org.apache.log4j.xml.XMLDecoder;
@@ -190,6 +195,10 @@
*/
private EventListenerList shutdownListenerList = new
EventListenerList();
private WelcomePanel welcomePanel;
+
+ private static final Object repositorySelectorGuard = new Object();
+ private static final LoggerRepositoryExImpl repositoryExImpl = new
LoggerRepositoryExImpl(LogManager.getLoggerRepository());
+
private PluginRegistry pluginRegistry;
/**
@@ -245,9 +254,19 @@
* @param args
*/
public static void main(String[] args) {
+
if(OSXIntegration.IS_OSX) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
+
+
+ LogManager.setRepositorySelector(new RepositorySelector() {
+
+ public LoggerRepository getLoggerRepository() {
+ return repositoryExImpl;
+ }}, repositorySelectorGuard);
+
+
ApplicationPreferenceModel model = new
ApplicationPreferenceModel();
SettingsManager.getInstance().configure(new
ApplicationPreferenceModelSaver(model));
@@ -298,6 +317,7 @@
showSplash(logUI);
}
logUI.cyclicBufferSize = model.getCyclicBufferSize();
+ logUI.pluginRegistry = repositoryExImpl.getPluginRegistry();
logUI.handler = new ChainsawAppenderHandler();
logUI.handler.addEventBatchListener(logUI.new
NewTabEventBatchReceiver());
@@ -1889,8 +1909,7 @@
try {
// we temporarily swap the TCCL so that plugins can
find resources
Thread.currentThread().setContextClassLoader
(classLoader);
- JoranConfigurator jc = new JoranConfigurator();
- jc.doConfigure(url, LogManager.getLoggerRepository());
+ PluginConfigurator.configure(url);
}finally{
// now switch it back...
Thread.currentThread().setContextClassLoader
(previousTCCL);
Index: src/java/org/apache/log4j/chainsaw/layout/EventDetailLayout.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
EventDetailLayout.java (working copy)
@@ -191,16 +191,15 @@
li = formatLocationInfo(event);
}
Hashtable properties = formatProperties(event);
- LoggingEvent copy = new LoggingEvent();
- copy.setLogger(logger);
- copy.setTimeStamp(event.getTimeStamp());
- copy.setLevel(event.getLevel());
- copy.setThreadName(threadName);
- copy.setMessage(msg);
- copy.setNDC(ndc);
- copy.setThrowableInformation(event.getThrowableInformation());
- copy.setLocationInformation(li);
- copy.setProperties(properties);
+ LoggingEvent copy = new LoggingEvent(null,
+ logger, event.getTimeStamp(),
+ event.getLevel(),
+ msg,
+ threadName,
+ event.getThrowableInformation(),
+ ndc,
+ li,
+ properties);
return copy;
}
Index: src/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
===================================================================
--- src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (revision 532553)
+++ src/java/org/apache/log4j/chainsaw/layout/
LayoutEditorPane.java (working copy)
@@ -182,16 +182,16 @@
ThrowableInformation tsr = new ThrowableInformation(new
Exception());
- event = new LoggingEvent();
- event.setLogger(Logger.getLogger("com.mycompany.mylogger"));
- event.setTimeStamp(new Date().getTime());
- event.setLevel(org.apache.log4j.Level.DEBUG);
- event.setThreadName("Thread-1");
- event.setMessage("The quick brown fox jumped over the lazy dog");
- event.setNDC("NDC string");
- event.setThrowableInformation(tsr);
- event.setLocationInformation(li);
- event.setProperties(hashTable);
+ event = new LoggingEvent("org.apache.log4j.Logger",
+ Logger.getLogger("com.mycompany.mylogger"),
+ new Date().getTime(),
+ org.apache.log4j.Level.DEBUG,
+ "The quick brown fox jumped over the lazy dog",
+ "Thread-1",
+ tsr,
+ "NDC string",
+ li,
+ hashTable);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
>
> I've committed a PluginConfigurator to both the component and log4j
> 1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>
Thanks, I'll give that a crack and see what we get.
>
> Been annoying trying to fix bugs in both branches and I have
> effectively stopped fixing bugs on the log4j 1.3 branch. It is a
> pretty substantial effort to work through the rest of Elias's
> changes and fix things up for another release.
>
there's only a couple of 1.3 related issues we might want to
consider, and then go to the discussion of an end-of-life for 1.3:
1.3 worth considering
=====================
Bug 37736 - LoggerEventListener's appenderRemovedEvent() and
levelChangedEvent() methods are never called
Bug 38411 - Setting threshold on RollingFileAppender fails on 1.3 alpha
Bug 41229 - jmxtools missing from pom.xml
This is already done in trunk, so can be closed off already.
Bug 41934 - DailyRollingFileAppender must chang as below
At the very least needs to be set to NEEDINFO
Bug 42171 - SocketHubReceiver duplicates messages
port to the receivers sandbox too
>
>>> I'd expect that we'd have a release push for log4j 1.2.x. and the
>>> companions when the PatternLayout backport looks reasonable. I
>>> cut a log4j 1.2.15 release candidate at the end of February (died
>>> for lack of quorum on the release vote) and people had been
>>> asking about it since December.
>>
>> We need to all talk together about the issue of quorum as a
>> group. We don't have a huge number of log4j PMC members as it is,
>> and some of them have been busy, or working on other things. At
>> some point we'll need to vote on something (a decision to
>> discontinue 1.3 and moving on to 2.0 designs for example), so we
>> probably shouldn't ignore it for too long. Perhaps we need a
>> discussion about where people are at?
>>
>
> I pushed as hard as I could to get responses on the log4j 1.2.15
> release vote. If we could have a discussion on why we don't have
> discussions, we'd not have a problem.
I can't speak for others, but I know I have previously been swamped
at work. I believe I can certainly review and help sign off on a .15
release. What exactly is the quorom we require?
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 21, 2007, at 7:07 PM, Paul Smith wrote:
>>
>> Yep and it can't be added to log4j 1.2 itself. Could add an
>> derived class (org.apache.log4j.plugins.PluginConfigurator ?) in
>> the components that supports it by overriding DOMConfigurator.
>> parse(Element). Could add a corresponding class in log4j 1.3
>> that is derived from its DOMConfigurator with no changed behavior
>> so you don't have to #ifdef your code (if you could do that). Do
>> you only need XML configuration or do you use a property file
>> configuration also?
>>
>>
>
> It might be worth a try, but the _least_ amount of effort is to
> tweak 1.3's LoggingEvent so that MDC values are deserialized
> correctly. That gets Chainsaw the only real missing 1.2
> compatibility.
I've committed a PluginConfigurator to both the component and log4j
1.3 and copied the LoggerRepositoryExImpl over to log4j 1.3.
>>
>
>> I hope that we have established that Chainsaw on log4j 1.2.x is
>> achievable. If I drop in a LoggerRepositoryExImpl into log4j 1.3,
>> hopefully you have one code base that will build and run against
>> both SVN head and log4j 1.2.x+companions. I'd like to get to the
>> point where you can commit the Chainsaw modifications that allow
>> either build option so we can pick it up whenever something
>> motivates a release.
>>
>
> It is of course achievable; I'm just wondering what the cost in
> time/effort it will be.
>
Been annoying trying to fix bugs in both branches and I have
effectively stopped fixing bugs on the log4j 1.3 branch. It is a
pretty substantial effort to work through the rest of Elias's changes
and fix things up for another release.
>> I'd expect that we'd have a release push for log4j 1.2.x. and the
>> companions when the PatternLayout backport looks reasonable. I
>> cut a log4j 1.2.15 release candidate at the end of February (died
>> for lack of quorum on the release vote) and people had been asking
>> about it since December.
>
> We need to all talk together about the issue of quorum as a group.
> We don't have a huge number of log4j PMC members as it is, and some
> of them have been busy, or working on other things. At some point
> we'll need to vote on something (a decision to discontinue 1.3 and
> moving on to 2.0 designs for example), so we probably shouldn't
> ignore it for too long. Perhaps we need a discussion about where
> people are at?
>
I pushed as hard as I could to get responses on the log4j 1.2.15
release vote. If we could have a discussion on why we don't have
discussions, we'd not have a problem.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
>
> Yep and it can't be added to log4j 1.2 itself. Could add an
> derived class (org.apache.log4j.plugins.PluginConfigurator ?) in
> the components that supports it by overriding DOMConfigurator. parse
> (Element). Could add a corresponding class in log4j 1.3 that is
> derived from its DOMConfigurator with no changed behavior so you
> don't have to #ifdef your code (if you could do that). Do you only
> need XML configuration or do you use a property file configuration
> also?
>
>
It might be worth a try, but the _least_ amount of effort is to tweak
1.3's LoggingEvent so that MDC values are deserialized correctly.
That gets Chainsaw the only real missing 1.2 compatibility.
>
> I hope that we have established that Chainsaw on log4j 1.2.x is
> achievable. If I drop in a LoggerRepositoryExImpl into log4j 1.3,
> hopefully you have one code base that will build and run against
> both SVN head and log4j 1.2.x+companions. I'd like to get to the
> point where you can commit the Chainsaw modifications that allow
> either build option so we can pick it up whenever something
> motivates a release.
>
It is of course achievable; I'm just wondering what the cost in time/
effort it will be.
> I'd expect that we'd have a release push for log4j 1.2.x. and the
> companions when the PatternLayout backport looks reasonable. I cut
> a log4j 1.2.15 release candidate at the end of February (died for
> lack of quorum on the release vote) and people had been asking
> about it since December.
We need to all talk together about the issue of quorum as a group.
We don't have a huge number of log4j PMC members as it is, and some
of them have been busy, or working on other things. At some point
we'll need to vote on something (a decision to discontinue 1.3 and
moving on to 2.0 designs for example), so we probably shouldn't
ignore it for too long. Perhaps we need a discussion about where
people are at?
cheers,
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 21, 2007, at 12:46 AM, Paul Smith wrote:
> Slippery slope here, Chainsaw is now starting up with no errors
> using log4j1.2, but when I try to load a configuration file I've
> been using ok prior, I get this output, and nothing appears to
> happen (see below).
>
> Obviously the DOMConfigurator in 1.2 knows nothing about plugins.
Yep and it can't be added to log4j 1.2 itself. Could add an derived
class (org.apache.log4j.plugins.PluginConfigurator ?) in the
components that supports it by overriding DOMConfigurator. parse
(Element). Could add a corresponding class in log4j 1.3 that is
derived from its DOMConfigurator with no changed behavior so you
don't have to #ifdef your code (if you could do that). Do you only
need XML configuration or do you use a property file configuration also?
> I wonder if we're going to constantly run into these sorts of
> problems.
Perhaps.
> Are we pushing the proverbial up hill here? Should we leave
> Chainsaw reliance on 1.3, and move on to working on 2.0?
>
I hope that we have established that Chainsaw on log4j 1.2.x is
achievable. If I drop in a LoggerRepositoryExImpl into log4j 1.3,
hopefully you have one code base that will build and run against both
SVN head and log4j 1.2.x+companions. I'd like to get to the point
where you can commit the Chainsaw modifications that allow either
build option so we can pick it up whenever something motivates a
release.
I'd expect that we'd have a release push for log4j 1.2.x. and the
companions when the PatternLayout backport looks reasonable. I cut a
log4j 1.2.15 release candidate at the end of February (died for lack
of quorum on the release vote) and people had been asking about it
since December.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
Slippery slope here, Chainsaw is now starting up with no errors using
log4j1.2, but when I try to load a configuration file I've been using
ok prior, I get this output, and nothing appears to happen (see below).
Obviously the DOMConfigurator in 1.2 knows nothing about plugins. I
wonder if we're going to constantly run into these sorts of
problems. Are we pushing the proverbial up hill here? Should we
leave Chainsaw reliance on 1.3, and move on to working on 2.0?
log4j:WARN Continuable parsing error 3 and column 82
log4j:WARN Element type "log4j:configuration" must be declared.
log4j:WARN Continuable parsing error 4 and column 73
log4j:WARN Element type "plugin" must be declared.
log4j:WARN Continuable parsing error 5 and column 40
log4j:WARN Element type "param" must be declared.
log4j:WARN Continuable parsing error 6 and column 46
log4j:WARN Element type "param" must be declared.
log4j:WARN Continuable parsing error 8 and column 75
log4j:WARN Element type "plugin" must be declared.
log4j:WARN Continuable parsing error 9 and column 46
log4j:WARN Element type "param" must be declared.
log4j:WARN Continuable parsing error 10 and column 40
log4j:WARN Element type "param" must be declared.
log4j:WARN Continuable parsing error 12 and column 10
log4j:WARN Element type "root" must be declared.
log4j:WARN Continuable parsing error 13 and column 29
log4j:WARN Element type "level" must be declared.
The XML configuration file is (I'm ssh tunneling in this case):
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration >
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
<plugin name="qaapp1"
class="org.apache.log4j.net.SocketHubReceiver">
<param name="Port" value="4560"/>
<param name="Host" value="127.0.0.1" />
</plugin>
<plugin name="qa index"
class="org.apache.log4j.net.SocketHubReceiver">
<param name="Host" value="127.0.0.1" />
<param name="Port" value="4561"/>
</plugin>
<root>
<level value="debug"/>
</root>
</log4j:configuration>
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
It would have probably been a good thing to check if PluginTestCase
was actually run in log4j 1.3 before I added it to the components
project. It wasn't (due to the override of the suite() method) and
once I tried running the tests they also failed on log4j 1.3. I
hacked the test suite so all tests pass on log4j 1.3 and then moved
it over the components project. Other than the means of getting a
PluginRegistry and a final log4j internal log message going to the
console instead of the log file, the tests are the same and pass in
both environments.
I've been playing around with the site generation and about ready to
replicate it on the other companion projects. There are a few
oddities that I think I'll need to ask for help on one of the Maven
mailing lists. The oddities I've seen:
An XML parsing error on the test report when running Maven 2.0.6
which doesn't occur on Maven 2.0.4.
Duplicate entries in the menu for the Surefire test report.
A false report of 100% coverage from the coverage analysis. This is
a known error that occurs in version 2.1 of the plugin, so the
pom.xml specifies that version 2.0 should be used. However, using
2.0 doesn't reliably produce a valid report. It seems to work better
if you delete any stray surefire* files from the base directory and
after removing ~/.m2/repository/org/codehaus/mojo/cobertura-maven-
plugin.
I've added a minimal build.xml file for the project and added a Gump
descriptor, so we should have a Gump building this shortly (the nags
go to me personally until things are checked out).
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Curt Arnold <ca...@apache.org>.
On Apr 18, 2007, at 11:05 PM, Paul Smith wrote:
>>
>> This is because the LoggerRepository is not of type
>> LoggerRepositoryEx. Chainsaw makes extensive use of the
>> PluginRegistry, and right now we have no central place where it
>> can access a PluginRegistry.
>>
>> What I'll do is create a PluginRegistry somewhere higher up, and
>> hand this down to the components that need that; bit more IoC
>> like. I wish I was more IoC aware earlier on.. :)
>>
>
> Hmm, I can see no other way around this than to create a copy of
> Hierarchy from log4 1.3, copy that into the component module, and
> setup a RepositorySelector during LogUI startup that causes the
> default LoggerRepository to become the new Hierarchy version.
> Given the naming conflict here, I would suggest we call it
> HierarchyEx .. ?
>
> Paul
>
I've added LoggerRepositoryExImpl to the components which implements
LoggerRepositoryEx with a mix of delegation to an underlying
LoggerRepository, code copied from log4j's 1.3 Hierarchy and fresh
code. Some behavior is degraded, for example, you can register
LoggingRepositoryEventListeners but they will never get called, set
properties but they aren't used in layout. LoggerEventListeners do
get called for the add appender and remove appender, but not level
change. Hopefully what it does implement is sufficient for
Chainsaw's use. If not, let me know what is needed and see if it can
be added to the proxy.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org
Re: Chainsaw & log4j 1.2 status
Posted by Paul Smith <ps...@aconex.com>.
>
> This is because the LoggerRepository is not of type
> LoggerRepositoryEx. Chainsaw makes extensive use of the
> PluginRegistry, and right now we have no central place where it can
> access a PluginRegistry.
>
> What I'll do is create a PluginRegistry somewhere higher up, and
> hand this down to the components that need that; bit more IoC
> like. I wish I was more IoC aware earlier on.. :)
>
Hmm, I can see no other way around this than to create a copy of
Hierarchy from log4 1.3, copy that into the component module, and
setup a RepositorySelector during LogUI startup that causes the
default LoggerRepository to become the new Hierarchy version. Given
the naming conflict here, I would suggest we call it HierarchyEx .. ?
Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org