Hi,
I have written a custom appender extending the log4j2 AbstractAppender. But
I am getting a runtime error[1]. I have added the plugin annotation[2] as
per the manual and the custom appender class contains factory method
createAppender() as well. I also have added the package name to
configurati
OSGi does interesting things with ClassLoaders. Log4j has to be able to access
your plugin when it is configuring. If it isn’t in an accessible ClassLoader it
won’t see it. There have been a few people who are using Log4j in an OSGi
environment that have helped out with patches from time to tim
Thanks for the prompt reply.
I have first tried my custom appender in OSGi environment which gave the
errors above. But I am getting the same issue in non-OSGi environment too.
It seems an issue with custom appender.
AFAIK It is plugin annotation that make the appender visible to log4j2. I
can't f
Hi all,
As I have mentioned in my first mail, the issue is only in the OSGi
environment it seems. I had mistakenly added the appender as a OSGi bundle
in the non-OSGi environment. Could resolve the issue after changing the
package to a jar.
Thanks,
Nipuni
On Wed, Feb 3, 2016 at 7:41 PM, Nipuni P
Thanks for confirming that.
You may avoid the classloader issues by combining the log4j jars and your
custom appender in a single jar.
The only tricky part here is that you'd need to combine the serialized plugin
listing files (see http://logging.apache.org/log4j/2.x/manual/plugins.html)
fro
Hi,
Thank you very much for the reply.
Initially I got error [1] when I am trying to test the appender in non-OSGi
environment. This was due to not passing the correct number of parameters
to the factory method. I have updated my log4j2.xml and then could solve
the issue[1] in non-OSGi env. I hav
Hi all,
Above mentioned issue is reported and fixed in[1]. I have tried to use
log4j2- 2.0.1 (as this is the fix version of the jira) in my OSGi
environment. But I still see the same CLASS_NOT_FOUND error while it works
fine in non-OSGi environment.
[1] https://issues.apache.org/jira/browse/LOG4J
I don’t believe that issue is related to your problem.
When Log4j loads plugins it can only find plugins on whatever class path it has
available to it. If it is in a different OSGi bundle than your plugin it may
not see it. In short, Log4j has to be able to find
META-INF/org/apache/logging/
Actually, I just looked at the code and there is a class that should be looking
at your bundle to locate any plugins you may have. I am actually not very
familiar with that code so I wonder if one of the other committers could
provide insight on what might be causing it not to work.
Ralph
> On
Thanks for the input.
Yes the issue may be different than what I have mentioned. I suspected that
the issue is related to Log4j2Plugins.dat file as the appender is working
fine in non-OSGi environment, and the only different I could find was
that Log4j2Plugins.dat
file comparing the two jars. May
I don’t think so. I suspect that
org.apache.logging.log4j.core.osgi.Activator.java is not finding your plugin
but I am not sure why.
Ralph
> On Feb 4, 2016, at 11:38 AM, Nipuni Piyabasi Perera
> wrote:
>
> Thanks for the input.
>
> Yes the issue may be different than what I have mentioned.
This sounds like it's probably a bug. Could you file an issue in jira?
On 4 February 2016 at 12:42, Ralph Goers wrote:
> I don’t think so. I suspect that
> org.apache.logging.log4j.core.osgi.Activator.java is not finding your
> plugin but I am not sure why.
>
> Ralph
>
> > On Feb 4, 2016, at 11:
Hi all,
This was a class loading issue in my OSGi environment. We were using
pax-logging 1.8.4 (which exports log4j2 2.0.2) and the class loader cannot
load the package (package read from the log4j2.xml configuration) as the
new bundle is not visible to the pax-logging bundle.
Could resolve it af
That sounds like a problem in pax-logging-log4j2 then. I wouldn't expect to
have to do that. Could you file an issue for pax-logging?
On 5 February 2016 at 10:44, Nipuni Piyabasi Perera
wrote:
> Hi all,
>
> This was a class loading issue in my OSGi environment. We were using
> pax-logging 1.8.4
Hi Matt,
I have posted this on ops4j group discussion.[1]
[1] https://groups.google.com/forum/#!topic/ops4j/QvSOAmOrACg
Thanks,
Nipuni
On Fri, Feb 5, 2016 at 10:39 PM, Matt Sicker wrote:
> That sounds like a problem in pax-logging-log4j2 then. I wouldn't expect to
> have to do that. Could you
15 matches
Mail list logo