Re: configuring a non-core appender in log4j2
Just as an FYI if you have multiple packages your start up time is going to be impacted. Getting the plugins from the file is orders of magnitude faster than dynamically locating them at runtime. I'd love to hear why it was necessary to build a single jar. Hardly anyone recommends doing that, especially when using Maven. Ralph On Mar 21, 2014, at 3:25 PM, Zabicki Roman (HERE/Chicago) roman.zabi...@here.com wrote: when I build -- you've described the problem exactly. I'm building with maven, and we combine all of our classes and all the classes from the jars we're dependent on into one single jar. This single jar can, of course, only have 1 Log4j2Plugin.dat. I have to stick with this build/deployment strategy. I can't deploy multiple jars. So I will use the packages attribute and let you know on Monday how it goes. Thanks for pointing that out. I had read that page before, but I didn't get it. -Original Message- From: Ralph Goers [mailto:ralph.go...@dslextreme.com] Sent: Friday, March 21, 2014 3:56 PM To: Log4J Users List Subject: Re: configuring a non-core appender in log4j2 If the log4j flume jar is in the class path it should automatically be included as it has its own Log4j2Plugin.dat file. However, you can always manually cause plugins to be located by specifying the packages attribute - see http://logging.apache.org/log4j/2.x/manual/configuration.html#XML. Again though, if it is not automatically finding the Flume Appender then there is either something wrong in your configuration or the log4j-flume-ng jar is not in the classpath. I'm curious though - when you say when I build what exactly are you building? You cannot build a new jar that includes the contents of log4j-core.jar and the contents of other jars that also have plugins as each has their own Log4j2Plugin.dat and only one of them will wind up in your new jar. To do that, yes you would have to run the PluginManager against the contents of your new jar to generate your own custom Log4j2Plugin.dat. However, doing that is not recommended. We recommend that you leave the Log4j jars alone and include them in your classpath. Ralph On Mar 21, 2014, at 12:30 PM, Zabicki Roman (HERE/Chicago) roman.zabi...@here.com wrote: Hi, I want to use a non-core appender with log4j2. In particular, I want to use the apache flume appender. (http://logging.apache.org/log4j/2.x/log4j-flume-ng/) When I build, I wind up with the Log4j2Plugins.dat from log4j, which doesn't have support for the flume appender, so I can't register the flume appender in my log4j2.xml. It seems that there's no way to register custom appender classes just via log4j2.xml, and instead I have to use PluginManager to register the \org\apache\logging\log4j\core\config\plugins\Log4j2Plugin.dat. I can't find any examples of how to do this, let alone examples of how to automate this in a build. Is it possible to register a custom appender class solely through log4j2.xml, or do I need to go through the PluginManager? Whatever the answer, can someone show me an example? I'm particularly interested in how to automate this in a build. Thanks, Roman - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org - To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org
Re: beta9 to rc1
HI I managed to *fix *the *look-up issue*, just configuring log4j2.xml. it works as expected. And more surprisingly , now it does not create an additional *${web *empty file like that was in *beta9* On a Side note, I did a Jmeter *perfTest 100 clients . *when I traced the threads with *Jconsole*, AsynLogger-1 show Block- [X] Wait - [X XX XXX] [X] : this number gets varied. Why there are many waiting threads ? are there configuration that I have to set ? Also still i'm getting that Tomcat [7.0.47] init exception. *catalina.out * Mar 21, 2014 6:54:29 PM org.apache.catalina.session.StandardManager doLoad SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at java.util.ArrayList.readObject(ArrayList.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at java.util.HashMap.readObject(HashMap.java:1030) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1597) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1062) at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284) at org.apache.catalina.session.StandardManager.load(StandardManager.java:204) at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at
Re: beta9 to rc1
Regarding the serialization exception, are you saving an object to the session that contains a reference to a non-static/non-transient Logger object? If so, that's why. Jake On Sun, 23 Mar 2014 08:45:40 +0530 Mahesh Dilhan mail.mahesh...@gmail.com wrote: HI I managed to *fix *the *look-up issue*, just configuring log4j2.xml. it works as expected. And more surprisingly , now it does not create an additional *${web *empty file like that was in *beta9* On a Side note, I did a Jmeter *perfTest 100 clients . *when I traced the threads with *Jconsole*, AsynLogger-1 show Block- [X] Wait - [X XX XXX] [X] : this number gets varied. Why there are many waiting threads ? are there configuration that I have to set ? Also still i'm getting that Tomcat [7.0.47] init exception. *catalina.out * Mar 21, 2014 6:54:29 PM org.apache.catalina.session.StandardManager doLoad SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.apache.logging.log4j.core.Logger$PrivateConfig at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1333) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at java.util.ArrayList.readObject(ArrayList.java:593) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at java.util.HashMap.readObject(HashMap.java:1030) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1597) at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1062) at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284) at org.apache.catalina.session.StandardManager.load(StandardManager.java:204) at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5443) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:983) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1660) at