I have written a Log4j2 custom Converter plugin in OSGi environment and
have used log4j2 with ops4j-pax-logging. The custom field is tenantId and I
have referred to it in the log4j2.xml as %tenantId. When I run the program
the logs gets printed as {thread-name}enantId.
Plugin class
package
Note that I wrote such a filter, which is under review ATM here:
- https://issues.apache.org/jira/browse/LOG4J2-1106
- https://issues.apache.org/jira/browse/LOG4J2-1105
Gary
On Thu, Aug 27, 2015 at 11:51 AM, Nicholas Duane nic...@msn.com wrote:
I've got a couple questions regarding plugins
I've got a couple questions regarding plugins I'm hoping someone might be able
to help me with. I checked the docs and it's still not quite clear.
1. I'm unsure what to set printObject to in my Plugin annotation. From
http://logging.apache.org/log4j/2.x/manual/extending.html it says
Based on your previous comments I assume one would show up out-of-the-box at
some point. Of course I need mine now so unfortunately I have to write one.
Any input on my questions below?
Thanks,
Nick
Date: Thu, 27 Aug 2015 12:20:07 -0700
Subject: Re: plugins
From: garydgreg...@gmail.com
level=ALL
AppenderRef ref=info/
/Logger
Root
/Root
/Loggers
/Configuration
Thanks,
Nick
Subject: Re: plugins
From: ralph.go...@dslextreme.com
Date: Thu, 27 Aug 2015 14:20:28 -0700
To: log4j-user@logging.apache.org
Can’t you just compare what you wrote to what Gary wrote
comments I assume one would show up out-of-the-box at
some point. Of course I need mine now so unfortunately I have to write one.
Any input on my questions below?
Thanks,
Nick
Date: Thu, 27 Aug 2015 12:20:07 -0700
Subject: Re: plugins
From: garydgreg...@gmail.com
To: log4j-user
Loggers
Logger name=HelloWorld level=ALL
AppenderRef ref=info/
/Logger
Root
/Root
/Loggers
/Configuration
Thanks,
Nick
Subject: Re: plugins
From: ralph.go...@dslextreme.com
Date: Thu, 27 Aug 2015 14:20:28 -0700
To: log4j-user@logging.apache.org
Can’t you just
LevelRangeFilter.class file. I added that to the packages attribute, as
you can see in the config I previously sent. It still doesn't work.
Thanks,
Nick
Subject: Re: plugins
From: remko.po...@gmail.com javascript:;
Date: Fri, 28 Aug 2015 07:25:35 +0900
To: log4j-user@logging.apache.org
printObject affects the way plugins are logged when you have status=debug
enabled. If you set printObject to true then the Plugin’s toString method will
be called to log the Plugin’s “name”. Usually, this is just the
SimpleClassName, but if the class name doesn’t match the Plugin name it can
I can filter on just a single level with my LevelRangeFilter.
Thanks for all the help. Next I have to get the latest log4j installed on
fedora 21 so that I can verify custom levels work.
Nick
Date: Fri, 28 Aug 2015 07:51:32 +0900
Subject: Re: plugins
From: remko.po...@gmail.com
Hi again,
this is all I could come up with.
I can't find another way but reflection atm.
This is so ugly. But it works.
Your thoughts on this?
Index:
src/main/java/org/apache/logging/log4j/core/config/plugins/ResolverUtil.java
Hi,
I've got an Application that is deployed via Java Web Start.
I also have custom @Plugin(s) i.e. a LogEventPatternConverter. Log4j2 picks the
packages directive of the config but fails to collect the plugins when started
via Web Start.
2013-10-24 13:49:29,617 DEBUG Found Plugin Map
LOG4J2-364 and contributed what I've got so far.
Regarding scanning the class path for plugins, I thought I had taken care of
this by executing the following line in a ServletContextListener that runs
before Log4j:
PluginManager.addPackage(WebLookup.class.getPackage().getName
on the attributes on the
Configuration element. Until the packages attribute is handled custom
lookups won't be found. Your custom Lookups should work for other elements
in the configuration. I'd like to see your Lookup to see if it could be
included as one of the hard-wired plugins.
Ralph
On Aug
On Fri, Aug 16, 2013 at 6:21 PM, David Nault
david.na...@criticalpath.netwrote:
Hi All,
We're using Log4j in a webapp and are looking at migrating to Log4j 2.
We'd like to continue writing our log files to a location under the
webapp's context root -- that is, under the directory returned
On Fri, Aug 16, 2013 at 7:54 PM, Gary Gregory garydgreg...@gmail.comwrote:
On Fri, Aug 16, 2013 at 6:21 PM, David Nault david.na...@criticalpath.net
wrote:
Hi All,
We're using Log4j in a webapp and are looking at migrating to Log4j 2.
We'd like to continue writing our log files to a
in the configuration. I'd
like to see your Lookup to see if it could be included as one of the hard-wired
plugins.
Ralph
On Aug 16, 2013, at 3:21 PM, David Nault wrote:
Hi All,
We're using Log4j in a webapp and are looking at migrating to Log4j 2.
We'd like to continue writing our log files
in my OSGi
application.
Any thoughs?
-Original Message-
From: Remko Popma [mailto:rem...@yahoo.com]
Sent: Tuesday, July 30, 2013 2:03 AM
To: Log4J Users List
Subject: Re: Are the custom appenders only like plugins?
Aliaksandr,
I don't think you need a specific OSGi version to make
I see... Did you try pre-building the binary file with plugin descriptors using
the PluginManager main method?
Sorry,
Do you mean binary file of my custom appender?
-Original Message-
From: Remko Popma [mailto:rem...@yahoo.com]
Sent: Tuesday, July 30, 2013 2:09 PM
To: Log4J-Users List
Subject: Re: Are the custom appenders only like plugins?
I see... Did you try pre-building the binary file
...@yahoo.com]
Sent: Tuesday, July 30, 2013 2:09 PM
To: Log4J-Users List
Subject: Re: Are the custom appenders only like plugins?
I see... Did you try pre-building the binary file with plugin descriptors
using the PluginManager main method
Sorry for being unclear. I#x27;ve explained it better in this Jira comment:
https://issues.apache.org/jira/browse/LOG4J2-232?focusedCommentId=13648502page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13648502
Hi Guys,
Trying to embed log4j2 in our OSGi application.
So, one small question: How can I create custom appender which will be
*not* a plugin? I want to create it like old school log4j1.x appender.
For the some reason we can not use osgi.core version = 4.3.0 in our
application, only =4.2.0.
Hi Guys,
Trying embed log4j2 in our OSGi application.
So, one small question: How can I create custom appender which will be
not a plugin? I want to create it like old school log4j1.x appender. The
cause: We cannot use osgi.core version = 4.3.0 in our application, only
=4.2.0. (As you know
Aliaksandr,
I don't think you need a specific OSGi version to make a plugin.
Remko
From: Aliaksandr Belavusau abelavu...@gmail.com
To: log4j-user@logging.apache.org
Sent: Tuesday, July 30, 2013 5:27 AM
Subject: Are the custom appenders only like plugins
25 matches
Mail list logo