You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Yair Ogen (yaogen)" <ya...@cisco.com> on 2014/07/17 14:43:17 UTC

Converter Plugin not loaded

I am trying to extend log4j2.

I created my own configuration factory that is loaded just fine. In there I give it a default pattern with some new converters.

I created a converter with the needed annotations. However, seems that the plugin manager is not picking these up. Only plugins that exists in "" are actually loaded.

What am I missing?

Yair


Re: Converter Plugin not loaded

Posted by Remko Popma <re...@gmail.com>.
On Thu, Jul 17, 2014 at 10:14 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Attached the plugin I am trying to add.
>

I cannot see any attachments. I think the mailing list software strips off
attachments...
Can you create a Jira ticket and attach your project to that ticket?
Thanks!


>
> I am also writing custom configuration that is programmatically based
> (i.e. no configuration file is used).
>
> I think the problem is due to the fact that the only way to load new
> plugins is via the plugin manager that only supports: loadPlugins(final
> ResourceLoader loader) that use DataInputStream with no apparent
> documentation on how this input stream should be composed.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Thursday, July 17, 2014 16:03
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that demonstrates
> the problem?
> You may want to create a Jira ticket to attach files to (the mailing list
> software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems that
> > the plugin manager is not picking these up. Only plugins that exists
> > in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
Attached the plugin I am trying to add.

I am also writing custom configuration that is programmatically based (i.e. no configuration file is used).

I think the problem is due to the fact that the only way to load new plugins is via the plugin manager that only supports: loadPlugins(final ResourceLoader loader) that use DataInputStream with no apparent documentation on how this input stream should be composed.

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com] 
Sent: Thursday, July 17, 2014 16:03
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

Would it be possible to provide a small sample project that demonstrates the problem?
You may want to create a Jira ticket to attach files to (the mailing list software does not like attachments).

Remko


On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Just recently joined the mailing list - can you please share?
>
> Yair
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 15:59
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I think it is related to my issue (previous email)
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
> 17 de julio de 2014 14:43
> Para: log4j-user@logging.apache.org
> Asunto: Converter Plugin not loaded
>
> I am trying to extend log4j2.
>
> I created my own configuration factory that is loaded just fine. In 
> there I give it a default pattern with some new converters.
>
> I created a converter with the needed annotations. However, seems that 
> the plugin manager is not picking these up. Only plugins that exists 
> in "" are actually loaded.
>
> What am I missing?
>
> Yair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com] 
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

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


Re: Converter Plugin not loaded

Posted by Matt Sicker <bo...@gmail.com>.
You just need to include log4j-core on your build classpath. It has an
annotation processor (PluginProcessor as you've noted) which runs via the
standard java compiler since at least 1.6. As long as you aren't disabling
the annotation processor, it should just sort of automatically work.

As for how to run it otherwise? Here's what I found about manually
specifying everything to javac:

javac -processorpath log4j-core-2.0.jar -processor
org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor (and
then all your other options)

Really, the important part is ensuring log4j-core is on your classpath. If
you're using -proc:none in javac, then it won't work!


On 17 July 2014 09:30, Yair Ogen (yaogen) <ya...@cisco.com> wrote:

> Running mvn clean install fails for me:
>
> [WARNING]
> java.lang.Exception: The specified mainClass doesn't contain a main method
> with appropriate signature.
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NoSuchMethodException:
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>         at java.lang.Class.getMethod(Class.java:1665)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>         ... 1 more
>
> Indeed no main method.  Perhaps you are not running with the released 2.0
> version?
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:21
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> Good question.
> Running mvn clean install my build does not inform of anything:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
> com.globalavl.commons --- [INFO] [INFO] ---
> maven-resources-plugin:2.6:resources (default-resources) @
> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
> com.globalavl.commons --- [WARNING] File encoding has not been set, using
> platform encoding Cp1252, i.e. build is platform dependent!
> [INFO] Compiling 4 source files to
> C:\dev\com.globalavl.commons\target\classes
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources
> (default-testResources) @ com.globalavl.commons --- [WARNING] Using
> platform encoding (Cp1252 actually) to copy filtered resources, i.e. build
> is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
> com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to
> date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @
> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO]
> [INFO] --- maven-install-plugin:2.4:install (default-install) @
> com.globalavl.commons --- [INFO] Installing
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2.092s
> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
> 16M/219M [INFO]
> ------------------------------------------------------------------------
>
> Pom part:
>
>                                 <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>exec-maven-plugin</artifactId>
>                                         <version>1.2.1</version>
>                                         <executions>
>                                                 <execution>
>
> <phase>process-classes</phase>
>                                                         <goals>
>
> <goal>java</goal>
>                                                         </goals>
>                                                 </execution>
>                                         </executions>
>                                         <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
>                                 </plugin>
>
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:16
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> How does it work? This class doesn't have a main?
>
> My mvn package run fails on:
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
> logging-log4j2: An exception occured while executing the Java class. The
> specified mainClass doesn't contain a main method with appropriate
> signature.
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
> -> [Help 1]
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:12
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> You are ritght, It Works with
>                                 <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
> And generates the dat file in META-INF
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:09
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> I now see that the documentation is not up to date. The main class should
> be:
>
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>
> as indicated in PluginManager:
>
>    /**
>      * Process annotated plugins.
>      * @deprecated Use {@link
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor}
> instead. To do
>      * so, simply include {@code log4j-core} in your dependencies and make
> sure annotation processing is not disabled.
>      * By default, supported Java compilers will automatically use that
> plugin processor provided {@code log4j-core}
>      * is on the classpath.
>      */
>     @Deprecated // use PluginProcessor instead
>     public static void main(final String[] args) {
>         System.err.println("WARNING: this tool is superseded by the
> annotation processor included in log4j-core.");
>         System.exit(-1);
>     }
>
> However, PluginProcessor doesn't contain a main...
>
> Catch 22?
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Yair Ogen (yaogen)
> Sent: Thursday, July 17, 2014 16:55
> To: 'Log4J Users List'
> Subject: RE: Converter Plugin not loaded
>
> I missed that.
>
> Added to my pom - should running mvn package be enough to generate the
> file?
>
> It looks like it doesn't.
>
> I see this warning:
>
> WARNING: this tool is superseded by the annotation processor included in
> log4j-core.
>
> And in the file system I have an empty directory:
>
> \target\generated-sources\annotations
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Thursday, July 17, 2014 16:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
> wrote:
>
> > In my case it find the *.dat file from core jar. Not clear how can we
> > add more custom plugins.
> >
>
> Do you build with maven? The Plugin Preloading section <
> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
> on the Plugins page gives a sample snippet to add to your pom.xml to make
> Maven generate the *.dat file for your plugins.
>
>
>
> > The same applies to my configuration plugin. I had to also use a
> > ContextFactory and call start(new MyNewConfiguration()) manually for
> > the custom configuration to work.
> >
> > Something in the plugin mechanism is not extension friendly.
> >
> > Best Regards,
> >
> > Yair Ogen
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 16:20
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I will try to do it bw today and tomorrow.
> > From what I see in code in pluginmanager:
> >
> >     private static PluginRegistry<PluginType<?>> decode(final
> > ResourceLoader loader) {
> >         final Enumeration<URL> resources;
> >         try {
> >             resources =
> > loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
> >             if (resources == null) {
> >                 return null;
> >             }
> >         } catch (final IOException ioe) {
> >             LOGGER.warn("Unable to preload plugins", ioe);
> >             return null;
> >         }
> >         final PluginRegistry<PluginType<?>> map = new
> > PluginRegistry<PluginType<?>>();
> >         while (resources.hasMoreElements()) {
> >
> > It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> > resources.hasMoreElements() == false
> >
> > Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE
> > exists on the jar file
> >
> >
> > -----Mensaje original-----
> > De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17
> > de julio de 2014 15:03
> > Para: Log4J Users List
> > Asunto: Re: Converter Plugin not loaded
> >
> > Would it be possible to provide a small sample project that
> > demonstrates the problem?
> > You may want to create a Jira ticket to attach files to (the mailing
> > list software does not like attachments).
> >
> > Remko
> >
> >
> > On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen)
> > <ya...@cisco.com>
> > wrote:
> >
> > > Just recently joined the mailing list - can you please share?
> > >
> > > Yair
> > >
> > > -----Original Message-----
> > > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > > Sent: Thursday, July 17, 2014 15:59
> > > To: Log4J Users List
> > > Subject: RE: Converter Plugin not loaded
> > >
> > > I think it is related to my issue (previous email)
> > >
> > > -----Mensaje original-----
> > > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > > 17 de julio de 2014 14:43
> > > Para: log4j-user@logging.apache.org
> > > Asunto: Converter Plugin not loaded
> > >
> > > I am trying to extend log4j2.
> > >
> > > I created my own configuration factory that is loaded just fine. In
> > > there I give it a default pattern with some new converters.
> > >
> > > I created a converter with the needed annotations. However, seems
> > > that the plugin manager is not picking these up. Only plugins that
> > > exists in "" are actually loaded.
> > >
> > > What am I missing?
> > >
> > > Yair
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
>  B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>    [  X  ܚX K  K[XZ[
>        ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>        ]\ \ Z [       [ ˘\ X  K ܙ B
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Converter Plugin not loaded

Posted by Matt Sicker <bo...@gmail.com>.
Feel free to upload it somewhere like GitHub or whatever. I love seeing how
people use log4j!


On 17 July 2014 10:16, Jaime Sastre <js...@globalavl.com> wrote:

> You were right, It was being skipped, I removed the pluging section from
> the pom and the dat file gets generated all the same (I guess it was
> through Java services mechanism)
> I think that I did not do a proper build when I switched to 2.0 or somehow
> my jar was cached, it looks fine now
> I can send you my small project if you wish I got  an appender and a layout
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com]
> Enviado el: jueves, 17 de julio de 2014 16:30
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> Running mvn clean install fails for me:
>
> [WARNING]
> java.lang.Exception: The specified mainClass doesn't contain a main method
> with appropriate signature.
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NoSuchMethodException:
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>         at java.lang.Class.getMethod(Class.java:1665)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>         ... 1 more
>
> Indeed no main method.  Perhaps you are not running with the released 2.0
> version?
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:21
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> Good question.
> Running mvn clean install my build does not inform of anything:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
> com.globalavl.commons --- [INFO] [INFO] ---
> maven-resources-plugin:2.6:resources (default-resources) @
> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
> com.globalavl.commons --- [WARNING] File encoding has not been set, using
> platform encoding Cp1252, i.e. build is platform dependent!
> [INFO] Compiling 4 source files to
> C:\dev\com.globalavl.commons\target\classes
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources
> (default-testResources) @ com.globalavl.commons --- [WARNING] Using
> platform encoding (Cp1252 actually) to copy filtered resources, i.e. build
> is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
> com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to
> date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @
> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO]
> [INFO] --- maven-install-plugin:2.4:install (default-install) @
> com.globalavl.commons --- [INFO] Installing
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2.092s
> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
> 16M/219M [INFO]
> ------------------------------------------------------------------------
>
> Pom part:
>
>                                 <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>exec-maven-plugin</artifactId>
>                                         <version>1.2.1</version>
>                                         <executions>
>                                                 <execution>
>
> <phase>process-classes</phase>
>                                                         <goals>
>
> <goal>java</goal>
>                                                         </goals>
>                                                 </execution>
>                                         </executions>
>                                         <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
>                                 </plugin>
>
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:16
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> How does it work? This class doesn't have a main?
>
> My mvn package run fails on:
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
> logging-log4j2: An exception occured while executing the Java class. The
> specified mainClass doesn't contain a main method with appropriate
> signature.
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
> -> [Help 1]
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:12
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> You are ritght, It Works with
>                                 <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
> And generates the dat file in META-INF
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:09
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> I now see that the documentation is not up to date. The main class should
> be:
>
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>
> as indicated in PluginManager:
>
>    /**
>      * Process annotated plugins.
>      * @deprecated Use {@link
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor}
> instead. To do
>      * so, simply include {@code log4j-core} in your dependencies and make
> sure annotation processing is not disabled.
>      * By default, supported Java compilers will automatically use that
> plugin processor provided {@code log4j-core}
>      * is on the classpath.
>      */
>     @Deprecated // use PluginProcessor instead
>     public static void main(final String[] args) {
>         System.err.println("WARNING: this tool is superseded by the
> annotation processor included in log4j-core.");
>         System.exit(-1);
>     }
>
> However, PluginProcessor doesn't contain a main...
>
> Catch 22?
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Yair Ogen (yaogen)
> Sent: Thursday, July 17, 2014 16:55
> To: 'Log4J Users List'
> Subject: RE: Converter Plugin not loaded
>
> I missed that.
>
> Added to my pom - should running mvn package be enough to generate the
> file?
>
> It looks like it doesn't.
>
> I see this warning:
>
> WARNING: this tool is superseded by the annotation processor included in
> log4j-core.
>
> And in the file system I have an empty directory:
>
> \target\generated-sources\annotations
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Thursday, July 17, 2014 16:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
> wrote:
>
> > In my case it find the *.dat file from core jar. Not clear how can we
> > add more custom plugins.
> >
>
> Do you build with maven? The Plugin Preloading section <
> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
> on the Plugins page gives a sample snippet to add to your pom.xml to make
> Maven generate the *.dat file for your plugins.
>
>
>
> > The same applies to my configuration plugin. I had to also use a
> > ContextFactory and call start(new MyNewConfiguration()) manually for
> > the custom configuration to work.
> >
> > Something in the plugin mechanism is not extension friendly.
> >
> > Best Regards,
> >
> > Yair Ogen
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 16:20
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I will try to do it bw today and tomorrow.
> > From what I see in code in pluginmanager:
> >
> >     private static PluginRegistry<PluginType<?>> decode(final
> > ResourceLoader loader) {
> >         final Enumeration<URL> resources;
> >         try {
> >             resources =
> > loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
> >             if (resources == null) {
> >                 return null;
> >             }
> >         } catch (final IOException ioe) {
> >             LOGGER.warn("Unable to preload plugins", ioe);
> >             return null;
> >         }
> >         final PluginRegistry<PluginType<?>> map = new
> > PluginRegistry<PluginType<?>>();
> >         while (resources.hasMoreElements()) {
> >
> > It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> > resources.hasMoreElements() == false
> >
> > Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE
> > exists on the jar file
> >
> >
> > -----Mensaje original-----
> > De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17
> > de julio de 2014 15:03
> > Para: Log4J Users List
> > Asunto: Re: Converter Plugin not loaded
> >
> > Would it be possible to provide a small sample project that
> > demonstrates the problem?
> > You may want to create a Jira ticket to attach files to (the mailing
> > list software does not like attachments).
> >
> > Remko
> >
> >
> > On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen)
> > <ya...@cisco.com>
> > wrote:
> >
> > > Just recently joined the mailing list - can you please share?
> > >
> > > Yair
> > >
> > > -----Original Message-----
> > > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > > Sent: Thursday, July 17, 2014 15:59
> > > To: Log4J Users List
> > > Subject: RE: Converter Plugin not loaded
> > >
> > > I think it is related to my issue (previous email)
> > >
> > > -----Mensaje original-----
> > > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > > 17 de julio de 2014 14:43
> > > Para: log4j-user@logging.apache.org
> > > Asunto: Converter Plugin not loaded
> > >
> > > I am trying to extend log4j2.
> > >
> > > I created my own configuration factory that is loaded just fine. In
> > > there I give it a default pattern with some new converters.
> > >
> > > I created a converter with the needed annotations. However, seems
> > > that the plugin manager is not picking these up. Only plugins that
> > > exists in "" are actually loaded.
> > >
> > > What am I missing?
> > >
> > > Yair
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
>  B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>    [  X  ܚX K  K[XZ[
>        ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>        ]\ \ Z [       [ ˘\ X  K ܙ B
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Converter Plugin not loaded

Posted by Matt Sicker <bo...@gmail.com>.
The manual on the site won't be updated until the site is regenerated.


On 20 July 2014 06:01, Yair Ogen (yaogen) <ya...@cisco.com> wrote:

> File --> Settings --> compiler --> Annotation Processors - check the box
> labeled: "Enable annotation processing".
>
> I then urn 'mvn package' within  Intellij.
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Sunday, July 20, 2014 11:41
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> Could you explain the steps you took to enable annotation processing in
> IntelliJ so we can include them in the manual?
>
> Sent from my iPhone
>
> > On 2014/07/20, at 16:54, "Yair Ogen (yaogen)" <ya...@cisco.com> wrote:
> >
> > The manual still references the maven exec plugin. That should be
> removed, no?
> >
> > My problem was that I didn't enable annotation processing in Intellij.
> >
> > Works fine now, thanks.
> >
> > Best Regards,
> >
> > Yair Ogen
> > W: (+972) (0) 2-589-4919
> > M: (+972) (0) 54-566-4919
> >
> > -----Original Message-----
> > From: Matt Sicker [mailto:boards@gmail.com]
> > Sent: Sunday, July 20, 2014 05:30
> > To: Log4J Users List
> > Subject: Re: Converter Plugin not loaded
> >
> > I updated the manual in regards to how to use the annotation processor
> if it doesn't work by default. It helps to compile your code using Maven,
> Gradle, Ant, or some other standard build tool rather than through the IDE.
> >
> >
> >> On 17 July 2014 10:22, Yair Ogen (yaogen) <ya...@cisco.com> wrote:
> >>
> >> Please do share your example as I don't seem to get it to work for me.
> >>
> >> On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
> >> You were right, It was being skipped, I removed the pluging section
> >> from the pom and the dat file gets generated all the same (I guess it
> >> was through Java services mechanism) I think that I did not do a
> >> proper build when I switched to 2.0 or somehow my jar was cached, it
> >> looks fine now I can send you my small project if you wish I got  an
> >> appender and a layout
> >>
> >>
> >> -----Mensaje original-----
> >> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> >> 17 de julio de 2014 16:30
> >> Para: Log4J Users List
> >> Asunto: RE: Converter Plugin not loaded
> >>
> >> Running mvn clean install fails for me:
> >>
> >> [WARNING]
> >> java.lang.Exception: The specified mainClass doesn't contain a main
> >> method with appropriate signature.
> >>        at
> org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
> >>        at java.lang.Thread.run(Thread.java:744)
> >> Caused by: java.lang.NoSuchMethodException:
> >>
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
> >>        at java.lang.Class.getMethod(Class.java:1665)
> >>        at
> org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
> >>        ... 1 more
> >>
> >> Indeed no main method.  Perhaps you are not running with the released
> >> 2.0 version?
> >>
> >> Best Regards,
> >>
> >> Yair Ogen
> >> W: (+972) (0) 2-589-4919
> >> M: (+972) (0) 54-566-4919
> >>
> >> -----Original Message-----
> >> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> >> Sent: Thursday, July 17, 2014 17:21
> >> To: Log4J Users List
> >> Subject: RE: Converter Plugin not loaded
> >>
> >> Good question.
> >> Running mvn clean install my build does not inform of anything:
> >>
> >> [INFO] Scanning for projects...
> >> [INFO]
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> -
> >> -- [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
> >> ---------------------------------------------------------------------
> >> -
> >> --
> >> [INFO]
> >> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
> >> com.globalavl.commons --- [INFO] [INFO] ---
> >> maven-resources-plugin:2.6:resources (default-resources) @
> >> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
> >> actually) to copy filtered resources, i.e. build is platform dependent!
> >> [INFO] Copying 0 resource
> >> [INFO]
> >> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
> >> com.globalavl.commons --- [WARNING] File encoding has not been set,
> >> using platform encoding Cp1252, i.e. build is platform dependent!
> >> [INFO] Compiling 4 source files to
> >> C:\dev\com.globalavl.commons\target\classes
> >> [INFO]
> >> [INFO] --- maven-resources-plugin:2.6:testResources
> >> (default-testResources) @ com.globalavl.commons --- [WARNING] Using
> >> platform encoding (Cp1252 actually) to copy filtered resources, i.e.
> >> build is platform dependent!
> >> [INFO] Copying 0 resource
> >> [INFO]
> >> [INFO] --- maven-compiler-plugin:2.5.1:testCompile
> >> (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to
> >> compile - all classes are up to date [INFO] [INFO] ---
> >> maven-surefire-plugin:2.12.4:test (default-test) @
> >> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
> >> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
> >> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPS
> >> H
> >> OT.jar
> >> [INFO]
> >> [INFO] --- maven-install-plugin:2.4:install (default-install) @
> >> com.globalavl.commons --- [INFO] Installing
> >> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPS
> >> H
> >> OT.jar
> >> to
> >> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.c
> >> o mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> >> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to
> >> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.c
> >> o mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> -
> >> --
> >> [INFO] BUILD SUCCESS
> >> [INFO]
> >> ---------------------------------------------------------------------
> >> -
> >> --
> >> [INFO] Total time: 2.092s
> >> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
> >> 16M/219M [INFO]
> >> ---------------------------------------------------------------------
> >> -
> >> --
> >>
> >> Pom part:
> >>
> >>                                <plugin>
> >>
> >> <groupId>org.codehaus.mojo</groupId>
> >>
> >> <artifactId>exec-maven-plugin</artifactId>
> >>                                        <version>1.2.1</version>
> >>                                        <executions>
> >>                                                <execution>
> >>
> >> <phase>process-classes</phase>
> >>                                                        <goals>
> >>
> >> <goal>java</goal>
> >>                                                        </goals>
> >>                                                </execution>
> >>                                        </executions>
> >>                                        <configuration>
> >>
> >>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
> >>                                                <arguments>
> >>
> >> <argument>${project.build.outputDirectory}</argument>
> >>
> >> <argument>com.globalavl.commons.log4j</argument>
> >>                                                </arguments>
> >>                                        </configuration>
> >>                                </plugin>
> >>
> >>
> >>
> >> -----Mensaje original-----
> >> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> >> 17 de julio de 2014 16:16
> >> Para: Log4J Users List
> >> Asunto: RE: Converter Plugin not loaded
> >>
> >> How does it work? This class doesn't have a main?
> >>
> >> My mvn package run fails on:
> >>
> >> [ERROR] Failed to execute goal
> >> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
> >> logging-log4j2: An exception occured while executing the Java class.
> >> The specified mainClass doesn't contain a main method with
> >> appropriate signature.
> >> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
> >> r
> >> .main([Ljava.lang.String;)
> >> -> [Help 1]
> >>
> >> Best Regards,
> >>
> >> Yair Ogen
> >> W: (+972) (0) 2-589-4919
> >> M: (+972) (0) 54-566-4919
> >>
> >> -----Original Message-----
> >> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> >> Sent: Thursday, July 17, 2014 17:12
> >> To: Log4J Users List
> >> Subject: RE: Converter Plugin not loaded
> >>
> >> You are ritght, It Works with
> >>                                <configuration>
> >>
> >>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
> >>                                                <arguments>
> >>
> >> <argument>${project.build.outputDirectory}</argument>
> >>
> >> <argument>com.globalavl.commons.log4j</argument>
> >>                                                </arguments>
> >>                                        </configuration> And generates
> >> the dat file in META-INF
> >>
> >> -----Mensaje original-----
> >> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> >> 17 de julio de 2014 16:09
> >> Para: Log4J Users List
> >> Asunto: RE: Converter Plugin not loaded
> >>
> >> I now see that the documentation is not up to date. The main class
> >> should
> >> be:
> >>
> >> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
> >> r
> >>
> >> as indicated in PluginManager:
> >>
> >>   /**
> >>     * Process annotated plugins.
> >>     * @deprecated Use {@link
> >> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
> >> r
> >> }
> >> instead. To do
> >>     * so, simply include {@code log4j-core} in your dependencies and
> >> make sure annotation processing is not disabled.
> >>     * By default, supported Java compilers will automatically use
> >> that plugin processor provided {@code log4j-core}
> >>     * is on the classpath.
> >>     */
> >>    @Deprecated // use PluginProcessor instead
> >>    public static void main(final String[] args) {
> >>        System.err.println("WARNING: this tool is superseded by the
> >> annotation processor included in log4j-core.");
> >>        System.exit(-1);
> >>    }
> >>
> >> However, PluginProcessor doesn't contain a main...
> >>
> >> Catch 22?
> >>
> >> Best Regards,
> >>
> >> Yair Ogen
> >>
> >> -----Original Message-----
> >> From: Yair Ogen (yaogen)
> >> Sent: Thursday, July 17, 2014 16:55
> >> To: 'Log4J Users List'
> >> Subject: RE: Converter Plugin not loaded
> >>
> >> I missed that.
> >>
> >> Added to my pom - should running mvn package be enough to generate
> >> the file?
> >>
> >> It looks like it doesn't.
> >>
> >> I see this warning:
> >>
> >> WARNING: this tool is superseded by the annotation processor included
> >> in log4j-core.
> >>
> >> And in the file system I have an empty directory:
> >>
> >> \target\generated-sources\annotations
> >>
> >> Best Regards,
> >>
> >> Yair Ogen
> >>
> >> -----Original Message-----
> >> From: Remko Popma [mailto:remko.popma@gmail.com]
> >> Sent: Thursday, July 17, 2014 16:30
> >> To: Log4J Users List
> >> Subject: Re: Converter Plugin not loaded
> >>
> >> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen)
> >> <ya...@cisco.com>
> >> wrote:
> >>
> >>> In my case it find the *.dat file from core jar. Not clear how can
> >>> we add more custom plugins.
> >>
> >> Do you build with maven? The Plugin Preloading section <
> >> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloa
> >> d
> >> ing> on the Plugins page gives a sample snippet to add to your
> >> ing> pom.xml
> >> to make Maven generate the *.dat file for your plugins.
> >>
> >>
> >>
> >>> The same applies to my configuration plugin. I had to also use a
> >>> ContextFactory and call start(new MyNewConfiguration()) manually for
> >>> the custom configuration to work.
> >>>
> >>> Something in the plugin mechanism is not extension friendly.
> >>>
> >>> Best Regards,
> >>>
> >>> Yair Ogen
> >>>
> >>> -----Original Message-----
> >>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> >>> Sent: Thursday, July 17, 2014 16:20
> >>> To: Log4J Users List
> >>> Subject: RE: Converter Plugin not loaded
> >>>
> >>> I will try to do it bw today and tomorrow.
> >>> From what I see in code in pluginmanager:
> >>>
> >>>    private static PluginRegistry<PluginType<?>> decode(final
> >>> ResourceLoader loader) {
> >>>        final Enumeration<URL> resources;
> >>>        try {
> >>>            resources =
> >>> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
> >>>            if (resources == null) {
> >>>                return null;
> >>>            }
> >>>        } catch (final IOException ioe) {
> >>>            LOGGER.warn("Unable to preload plugins", ioe);
> >>>            return null;
> >>>        }
> >>>        final PluginRegistry<PluginType<?>> map = new
> >>> PluginRegistry<PluginType<?>>();
> >>>        while (resources.hasMoreElements()) {
> >>>
> >>> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> >>> resources.hasMoreElements() == false
> >>>
> >>> Probably a classloading issue since
> >>> PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file
> >>>
> >>>
> >>> -----Mensaje original-----
> >>> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves,
> >>> 17 de julio de 2014 15:03
> >>> Para: Log4J Users List
> >>> Asunto: Re: Converter Plugin not loaded
> >>>
> >>> Would it be possible to provide a small sample project that
> >>> demonstrates the problem?
> >>> You may want to create a Jira ticket to attach files to (the mailing
> >>> list software does not like attachments).
> >>>
> >>> Remko
> >>>
> >>>
> >>> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen)
> >>> <ya...@cisco.com>
> >>> wrote:
> >>>
> >>>> Just recently joined the mailing list - can you please share?
> >>>>
> >>>> Yair
> >>>>
> >>>> -----Original Message-----
> >>>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> >>>> Sent: Thursday, July 17, 2014 15:59
> >>>> To: Log4J Users List
> >>>> Subject: RE: Converter Plugin not loaded
> >>>>
> >>>> I think it is related to my issue (previous email)
> >>>>
> >>>> -----Mensaje original-----
> >>>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el:
> >>>> jueves,
> >>>> 17 de julio de 2014 14:43
> >>>> Para: log4j-user@logging.apache.org
> >>>> Asunto: Converter Plugin not loaded
> >>>>
> >>>> I am trying to extend log4j2.
> >>>>
> >>>> I created my own configuration factory that is loaded just fine.
> >>>> In there I give it a default pattern with some new converters.
> >>>>
> >>>> I created a converter with the needed annotations. However, seems
> >>>> that the plugin manager is not picking these up. Only plugins that
> >>>> exists in "" are actually loaded.
> >>>>
> >>>> What am I missing?
> >>>>
> >>>> Yair
> >>>>
> >>>>
> >>>> ------------------------------------------------------------------
> >>>> --
> >>>> - To unsubscribe, e-mail:
> >>>> log4j-user-unsubscribe@logging.apache.org
> >>>> For additional commands, e-mail:
> >>>> log4j-user-help@logging.apache.org
> >>>>
> >>>>
> >>>> ------------------------------------------------------------------
> >>>> --
> >>>> - To unsubscribe, e-mail:
> >>>> log4j-user-unsubscribe@logging.apache.org
> >>>> For additional commands, e-mail:
> >>>> log4j-user-help@logging.apache.org
> >> B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
> >>   [  X  ܚX K  K[XZ[
> >>       ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
> >>       ]\ \ Z [       [ ˘\ X  K ܙ B
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
File --> Settings --> compiler --> Annotation Processors - check the box labeled: "Enable annotation processing".

I then urn 'mvn package' within  Intellij.

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com] 
Sent: Sunday, July 20, 2014 11:41
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

Could you explain the steps you took to enable annotation processing in IntelliJ so we can include them in the manual?

Sent from my iPhone

> On 2014/07/20, at 16:54, "Yair Ogen (yaogen)" <ya...@cisco.com> wrote:
> 
> The manual still references the maven exec plugin. That should be removed, no?
> 
> My problem was that I didn't enable annotation processing in Intellij.
> 
> Works fine now, thanks.
> 
> Best Regards,
>  
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
> 
> -----Original Message-----
> From: Matt Sicker [mailto:boards@gmail.com]
> Sent: Sunday, July 20, 2014 05:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
> 
> I updated the manual in regards to how to use the annotation processor if it doesn't work by default. It helps to compile your code using Maven, Gradle, Ant, or some other standard build tool rather than through the IDE.
> 
> 
>> On 17 July 2014 10:22, Yair Ogen (yaogen) <ya...@cisco.com> wrote:
>> 
>> Please do share your example as I don't seem to get it to work for me.
>> 
>> On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
>> You were right, It was being skipped, I removed the pluging section 
>> from the pom and the dat file gets generated all the same (I guess it 
>> was through Java services mechanism) I think that I did not do a 
>> proper build when I switched to 2.0 or somehow my jar was cached, it 
>> looks fine now I can send you my small project if you wish I got  an 
>> appender and a layout
>> 
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
>> 17 de julio de 2014 16:30
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> Running mvn clean install fails for me:
>> 
>> [WARNING]
>> java.lang.Exception: The specified mainClass doesn't contain a main 
>> method with appropriate signature.
>>        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>>        at java.lang.Thread.run(Thread.java:744)
>> Caused by: java.lang.NoSuchMethodException:
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>>        at java.lang.Class.getMethod(Class.java:1665)
>>        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>>        ... 1 more
>> 
>> Indeed no main method.  Perhaps you are not running with the released
>> 2.0 version?
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> W: (+972) (0) 2-589-4919
>> M: (+972) (0) 54-566-4919
>> 
>> -----Original Message-----
>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>> Sent: Thursday, July 17, 2014 17:21
>> To: Log4J Users List
>> Subject: RE: Converter Plugin not loaded
>> 
>> Good question.
>> Running mvn clean install my build does not inform of anything:
>> 
>> [INFO] Scanning for projects...
>> [INFO]
>> [INFO]
>> ---------------------------------------------------------------------
>> -
>> -- [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
>> ---------------------------------------------------------------------
>> -
>> --
>> [INFO]
>> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
>> com.globalavl.commons --- [INFO] [INFO] --- 
>> maven-resources-plugin:2.6:resources (default-resources) @ 
>> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
>> actually) to copy filtered resources, i.e. build is platform dependent!
>> [INFO] Copying 0 resource
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ 
>> com.globalavl.commons --- [WARNING] File encoding has not been set, 
>> using platform encoding Cp1252, i.e. build is platform dependent!
>> [INFO] Compiling 4 source files to
>> C:\dev\com.globalavl.commons\target\classes
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.6:testResources
>> (default-testResources) @ com.globalavl.commons --- [WARNING] Using 
>> platform encoding (Cp1252 actually) to copy filtered resources, i.e.
>> build is platform dependent!
>> [INFO] Copying 0 resource
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:testCompile
>> (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to 
>> compile - all classes are up to date [INFO] [INFO] --- 
>> maven-surefire-plugin:2.12.4:test (default-test) @ 
>> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
>> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
>> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPS
>> H
>> OT.jar
>> [INFO]
>> [INFO] --- maven-install-plugin:2.4:install (default-install) @ 
>> com.globalavl.commons --- [INFO] Installing 
>> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPS
>> H
>> OT.jar
>> to
>> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.c
>> o mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
>> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to 
>> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.c
>> o mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
>> [INFO]
>> ---------------------------------------------------------------------
>> -
>> --
>> [INFO] BUILD SUCCESS
>> [INFO]
>> ---------------------------------------------------------------------
>> -
>> --
>> [INFO] Total time: 2.092s
>> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
>> 16M/219M [INFO]
>> ---------------------------------------------------------------------
>> -
>> --
>> 
>> Pom part:
>> 
>>                                <plugin>
>> 
>> <groupId>org.codehaus.mojo</groupId>
>> 
>> <artifactId>exec-maven-plugin</artifactId>
>>                                        <version>1.2.1</version>
>>                                        <executions>
>>                                                <execution>
>> 
>> <phase>process-classes</phase>
>>                                                        <goals>
>> 
>> <goal>java</goal>
>>                                                        </goals>
>>                                                </execution>
>>                                        </executions>
>>                                        <configuration>
>> 
>> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>>                                                <arguments>
>> 
>> <argument>${project.build.outputDirectory}</argument>
>> 
>> <argument>com.globalavl.commons.log4j</argument>
>>                                                </arguments>
>>                                        </configuration>
>>                                </plugin>
>> 
>> 
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
>> 17 de julio de 2014 16:16
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> How does it work? This class doesn't have a main?
>> 
>> My mvn package run fails on:
>> 
>> [ERROR] Failed to execute goal
>> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
>> logging-log4j2: An exception occured while executing the Java class. 
>> The specified mainClass doesn't contain a main method with 
>> appropriate signature.
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
>> r
>> .main([Ljava.lang.String;)
>> -> [Help 1]
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> W: (+972) (0) 2-589-4919
>> M: (+972) (0) 54-566-4919
>> 
>> -----Original Message-----
>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>> Sent: Thursday, July 17, 2014 17:12
>> To: Log4J Users List
>> Subject: RE: Converter Plugin not loaded
>> 
>> You are ritght, It Works with
>>                                <configuration>
>> 
>> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>>                                                <arguments>
>> 
>> <argument>${project.build.outputDirectory}</argument>
>> 
>> <argument>com.globalavl.commons.log4j</argument>
>>                                                </arguments>
>>                                        </configuration> And generates 
>> the dat file in META-INF
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
>> 17 de julio de 2014 16:09
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> I now see that the documentation is not up to date. The main class 
>> should
>> be:
>> 
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
>> r
>> 
>> as indicated in PluginManager:
>> 
>>   /**
>>     * Process annotated plugins.
>>     * @deprecated Use {@link
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcesso
>> r
>> }
>> instead. To do
>>     * so, simply include {@code log4j-core} in your dependencies and 
>> make sure annotation processing is not disabled.
>>     * By default, supported Java compilers will automatically use 
>> that plugin processor provided {@code log4j-core}
>>     * is on the classpath.
>>     */
>>    @Deprecated // use PluginProcessor instead
>>    public static void main(final String[] args) {
>>        System.err.println("WARNING: this tool is superseded by the 
>> annotation processor included in log4j-core.");
>>        System.exit(-1);
>>    }
>> 
>> However, PluginProcessor doesn't contain a main...
>> 
>> Catch 22?
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> 
>> -----Original Message-----
>> From: Yair Ogen (yaogen)
>> Sent: Thursday, July 17, 2014 16:55
>> To: 'Log4J Users List'
>> Subject: RE: Converter Plugin not loaded
>> 
>> I missed that.
>> 
>> Added to my pom - should running mvn package be enough to generate 
>> the file?
>> 
>> It looks like it doesn't.
>> 
>> I see this warning:
>> 
>> WARNING: this tool is superseded by the annotation processor included 
>> in log4j-core.
>> 
>> And in the file system I have an empty directory:
>> 
>> \target\generated-sources\annotations
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> 
>> -----Original Message-----
>> From: Remko Popma [mailto:remko.popma@gmail.com]
>> Sent: Thursday, July 17, 2014 16:30
>> To: Log4J Users List
>> Subject: Re: Converter Plugin not loaded
>> 
>> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) 
>> <ya...@cisco.com>
>> wrote:
>> 
>>> In my case it find the *.dat file from core jar. Not clear how can 
>>> we add more custom plugins.
>> 
>> Do you build with maven? The Plugin Preloading section < 
>> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloa
>> d
>> ing> on the Plugins page gives a sample snippet to add to your 
>> ing> pom.xml
>> to make Maven generate the *.dat file for your plugins.
>> 
>> 
>> 
>>> The same applies to my configuration plugin. I had to also use a 
>>> ContextFactory and call start(new MyNewConfiguration()) manually for 
>>> the custom configuration to work.
>>> 
>>> Something in the plugin mechanism is not extension friendly.
>>> 
>>> Best Regards,
>>> 
>>> Yair Ogen
>>> 
>>> -----Original Message-----
>>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>>> Sent: Thursday, July 17, 2014 16:20
>>> To: Log4J Users List
>>> Subject: RE: Converter Plugin not loaded
>>> 
>>> I will try to do it bw today and tomorrow.
>>> From what I see in code in pluginmanager:
>>> 
>>>    private static PluginRegistry<PluginType<?>> decode(final 
>>> ResourceLoader loader) {
>>>        final Enumeration<URL> resources;
>>>        try {
>>>            resources =
>>> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>>>            if (resources == null) {
>>>                return null;
>>>            }
>>>        } catch (final IOException ioe) {
>>>            LOGGER.warn("Unable to preload plugins", ioe);
>>>            return null;
>>>        }
>>>        final PluginRegistry<PluginType<?>> map = new 
>>> PluginRegistry<PluginType<?>>();
>>>        while (resources.hasMoreElements()) {
>>> 
>>> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
>>> resources.hasMoreElements() == false
>>> 
>>> Probably a classloading issue since 
>>> PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file
>>> 
>>> 
>>> -----Mensaje original-----
>>> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves,
>>> 17 de julio de 2014 15:03
>>> Para: Log4J Users List
>>> Asunto: Re: Converter Plugin not loaded
>>> 
>>> Would it be possible to provide a small sample project that 
>>> demonstrates the problem?
>>> You may want to create a Jira ticket to attach files to (the mailing 
>>> list software does not like attachments).
>>> 
>>> Remko
>>> 
>>> 
>>> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
>>> <ya...@cisco.com>
>>> wrote:
>>> 
>>>> Just recently joined the mailing list - can you please share?
>>>> 
>>>> Yair
>>>> 
>>>> -----Original Message-----
>>>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>>>> Sent: Thursday, July 17, 2014 15:59
>>>> To: Log4J Users List
>>>> Subject: RE: Converter Plugin not loaded
>>>> 
>>>> I think it is related to my issue (previous email)
>>>> 
>>>> -----Mensaje original-----
>>>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: 
>>>> jueves,
>>>> 17 de julio de 2014 14:43
>>>> Para: log4j-user@logging.apache.org
>>>> Asunto: Converter Plugin not loaded
>>>> 
>>>> I am trying to extend log4j2.
>>>> 
>>>> I created my own configuration factory that is loaded just fine. 
>>>> In there I give it a default pattern with some new converters.
>>>> 
>>>> I created a converter with the needed annotations. However, seems 
>>>> that the plugin manager is not picking these up. Only plugins that 
>>>> exists in "" are actually loaded.
>>>> 
>>>> What am I missing?
>>>> 
>>>> Yair
>>>> 
>>>> 
>>>> ------------------------------------------------------------------
>>>> --
>>>> - To unsubscribe, e-mail: 
>>>> log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: 
>>>> log4j-user-help@logging.apache.org
>>>> 
>>>> 
>>>> ------------------------------------------------------------------
>>>> --
>>>> - To unsubscribe, e-mail: 
>>>> log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: 
>>>> log4j-user-help@logging.apache.org
>> B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>>   [  X  ܚX K  K[XZ[
>>       ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>>       ]\ \ Z [       [ ˘\ X  K ܙ B
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> --
> Matt Sicker <bo...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

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


Re: Converter Plugin not loaded

Posted by Remko Popma <re...@gmail.com>.
Could you explain the steps you took to enable annotation processing in IntelliJ so we can include them in the manual?

Sent from my iPhone

> On 2014/07/20, at 16:54, "Yair Ogen (yaogen)" <ya...@cisco.com> wrote:
> 
> The manual still references the maven exec plugin. That should be removed, no?
> 
> My problem was that I didn't enable annotation processing in Intellij.
> 
> Works fine now, thanks.
> 
> Best Regards,
>  
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
> 
> -----Original Message-----
> From: Matt Sicker [mailto:boards@gmail.com] 
> Sent: Sunday, July 20, 2014 05:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
> 
> I updated the manual in regards to how to use the annotation processor if it doesn't work by default. It helps to compile your code using Maven, Gradle, Ant, or some other standard build tool rather than through the IDE.
> 
> 
>> On 17 July 2014 10:22, Yair Ogen (yaogen) <ya...@cisco.com> wrote:
>> 
>> Please do share your example as I don't seem to get it to work for me.
>> 
>> On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
>> You were right, It was being skipped, I removed the pluging section 
>> from the pom and the dat file gets generated all the same (I guess it 
>> was through Java services mechanism) I think that I did not do a 
>> proper build when I switched to 2.0 or somehow my jar was cached, it 
>> looks fine now I can send you my small project if you wish I got  an 
>> appender and a layout
>> 
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
>> 17 de julio de 2014 16:30
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> Running mvn clean install fails for me:
>> 
>> [WARNING]
>> java.lang.Exception: The specified mainClass doesn't contain a main 
>> method with appropriate signature.
>>        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>>        at java.lang.Thread.run(Thread.java:744)
>> Caused by: java.lang.NoSuchMethodException:
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>>        at java.lang.Class.getMethod(Class.java:1665)
>>        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>>        ... 1 more
>> 
>> Indeed no main method.  Perhaps you are not running with the released 
>> 2.0 version?
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> W: (+972) (0) 2-589-4919
>> M: (+972) (0) 54-566-4919
>> 
>> -----Original Message-----
>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>> Sent: Thursday, July 17, 2014 17:21
>> To: Log4J Users List
>> Subject: RE: Converter Plugin not loaded
>> 
>> Good question.
>> Running mvn clean install my build does not inform of anything:
>> 
>> [INFO] Scanning for projects...
>> [INFO]
>> [INFO]
>> ----------------------------------------------------------------------
>> -- [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO]
>> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
>> com.globalavl.commons --- [INFO] [INFO] --- 
>> maven-resources-plugin:2.6:resources (default-resources) @ 
>> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
>> actually) to copy filtered resources, i.e. build is platform dependent!
>> [INFO] Copying 0 resource
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ 
>> com.globalavl.commons --- [WARNING] File encoding has not been set, 
>> using platform encoding Cp1252, i.e. build is platform dependent!
>> [INFO] Compiling 4 source files to
>> C:\dev\com.globalavl.commons\target\classes
>> [INFO]
>> [INFO] --- maven-resources-plugin:2.6:testResources
>> (default-testResources) @ com.globalavl.commons --- [WARNING] Using 
>> platform encoding (Cp1252 actually) to copy filtered resources, i.e. 
>> build is platform dependent!
>> [INFO] Copying 0 resource
>> [INFO]
>> [INFO] --- maven-compiler-plugin:2.5.1:testCompile 
>> (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to 
>> compile - all classes are up to date [INFO] [INFO] --- 
>> maven-surefire-plugin:2.12.4:test (default-test) @ 
>> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
>> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
>> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSH
>> OT.jar
>> [INFO]
>> [INFO] --- maven-install-plugin:2.4:install (default-install) @ 
>> com.globalavl.commons --- [INFO] Installing 
>> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSH
>> OT.jar
>> to
>> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.co
>> mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
>> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to 
>> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.co
>> mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO] BUILD SUCCESS
>> [INFO]
>> ----------------------------------------------------------------------
>> --
>> [INFO] Total time: 2.092s
>> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
>> 16M/219M [INFO]
>> ----------------------------------------------------------------------
>> --
>> 
>> Pom part:
>> 
>>                                <plugin>
>> 
>> <groupId>org.codehaus.mojo</groupId>
>> 
>> <artifactId>exec-maven-plugin</artifactId>
>>                                        <version>1.2.1</version>
>>                                        <executions>
>>                                                <execution>
>> 
>> <phase>process-classes</phase>
>>                                                        <goals>
>> 
>> <goal>java</goal>
>>                                                        </goals>
>>                                                </execution>
>>                                        </executions>
>>                                        <configuration>
>> 
>> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>>                                                <arguments>
>> 
>> <argument>${project.build.outputDirectory}</argument>
>> 
>> <argument>com.globalavl.commons.log4j</argument>
>>                                                </arguments>
>>                                        </configuration>
>>                                </plugin>
>> 
>> 
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
>> 17 de julio de 2014 16:16
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> How does it work? This class doesn't have a main?
>> 
>> My mvn package run fails on:
>> 
>> [ERROR] Failed to execute goal
>> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
>> logging-log4j2: An exception occured while executing the Java class. 
>> The specified mainClass doesn't contain a main method with appropriate 
>> signature.
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>> .main([Ljava.lang.String;)
>> -> [Help 1]
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> W: (+972) (0) 2-589-4919
>> M: (+972) (0) 54-566-4919
>> 
>> -----Original Message-----
>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>> Sent: Thursday, July 17, 2014 17:12
>> To: Log4J Users List
>> Subject: RE: Converter Plugin not loaded
>> 
>> You are ritght, It Works with
>>                                <configuration>
>> 
>> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>>                                                <arguments>
>> 
>> <argument>${project.build.outputDirectory}</argument>
>> 
>> <argument>com.globalavl.commons.log4j</argument>
>>                                                </arguments>
>>                                        </configuration> And generates 
>> the dat file in META-INF
>> 
>> -----Mensaje original-----
>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
>> 17 de julio de 2014 16:09
>> Para: Log4J Users List
>> Asunto: RE: Converter Plugin not loaded
>> 
>> I now see that the documentation is not up to date. The main class 
>> should
>> be:
>> 
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>> 
>> as indicated in PluginManager:
>> 
>>   /**
>>     * Process annotated plugins.
>>     * @deprecated Use {@link
>> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>> }
>> instead. To do
>>     * so, simply include {@code log4j-core} in your dependencies and 
>> make sure annotation processing is not disabled.
>>     * By default, supported Java compilers will automatically use 
>> that plugin processor provided {@code log4j-core}
>>     * is on the classpath.
>>     */
>>    @Deprecated // use PluginProcessor instead
>>    public static void main(final String[] args) {
>>        System.err.println("WARNING: this tool is superseded by the 
>> annotation processor included in log4j-core.");
>>        System.exit(-1);
>>    }
>> 
>> However, PluginProcessor doesn't contain a main...
>> 
>> Catch 22?
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> 
>> -----Original Message-----
>> From: Yair Ogen (yaogen)
>> Sent: Thursday, July 17, 2014 16:55
>> To: 'Log4J Users List'
>> Subject: RE: Converter Plugin not loaded
>> 
>> I missed that.
>> 
>> Added to my pom - should running mvn package be enough to generate the 
>> file?
>> 
>> It looks like it doesn't.
>> 
>> I see this warning:
>> 
>> WARNING: this tool is superseded by the annotation processor included 
>> in log4j-core.
>> 
>> And in the file system I have an empty directory:
>> 
>> \target\generated-sources\annotations
>> 
>> Best Regards,
>> 
>> Yair Ogen
>> 
>> -----Original Message-----
>> From: Remko Popma [mailto:remko.popma@gmail.com]
>> Sent: Thursday, July 17, 2014 16:30
>> To: Log4J Users List
>> Subject: Re: Converter Plugin not loaded
>> 
>> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) 
>> <ya...@cisco.com>
>> wrote:
>> 
>>> In my case it find the *.dat file from core jar. Not clear how can 
>>> we add more custom plugins.
>> 
>> Do you build with maven? The Plugin Preloading section < 
>> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preload
>> ing> on the Plugins page gives a sample snippet to add to your pom.xml 
>> to make Maven generate the *.dat file for your plugins.
>> 
>> 
>> 
>>> The same applies to my configuration plugin. I had to also use a 
>>> ContextFactory and call start(new MyNewConfiguration()) manually for 
>>> the custom configuration to work.
>>> 
>>> Something in the plugin mechanism is not extension friendly.
>>> 
>>> Best Regards,
>>> 
>>> Yair Ogen
>>> 
>>> -----Original Message-----
>>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>>> Sent: Thursday, July 17, 2014 16:20
>>> To: Log4J Users List
>>> Subject: RE: Converter Plugin not loaded
>>> 
>>> I will try to do it bw today and tomorrow.
>>> From what I see in code in pluginmanager:
>>> 
>>>    private static PluginRegistry<PluginType<?>> decode(final 
>>> ResourceLoader loader) {
>>>        final Enumeration<URL> resources;
>>>        try {
>>>            resources =
>>> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>>>            if (resources == null) {
>>>                return null;
>>>            }
>>>        } catch (final IOException ioe) {
>>>            LOGGER.warn("Unable to preload plugins", ioe);
>>>            return null;
>>>        }
>>>        final PluginRegistry<PluginType<?>> map = new 
>>> PluginRegistry<PluginType<?>>();
>>>        while (resources.hasMoreElements()) {
>>> 
>>> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
>>> resources.hasMoreElements() == false
>>> 
>>> Probably a classloading issue since 
>>> PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file
>>> 
>>> 
>>> -----Mensaje original-----
>>> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 
>>> 17 de julio de 2014 15:03
>>> Para: Log4J Users List
>>> Asunto: Re: Converter Plugin not loaded
>>> 
>>> Would it be possible to provide a small sample project that 
>>> demonstrates the problem?
>>> You may want to create a Jira ticket to attach files to (the mailing 
>>> list software does not like attachments).
>>> 
>>> Remko
>>> 
>>> 
>>> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
>>> <ya...@cisco.com>
>>> wrote:
>>> 
>>>> Just recently joined the mailing list - can you please share?
>>>> 
>>>> Yair
>>>> 
>>>> -----Original Message-----
>>>> From: Jaime Sastre [mailto:jsastre@globalavl.com]
>>>> Sent: Thursday, July 17, 2014 15:59
>>>> To: Log4J Users List
>>>> Subject: RE: Converter Plugin not loaded
>>>> 
>>>> I think it is related to my issue (previous email)
>>>> 
>>>> -----Mensaje original-----
>>>> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: 
>>>> jueves,
>>>> 17 de julio de 2014 14:43
>>>> Para: log4j-user@logging.apache.org
>>>> Asunto: Converter Plugin not loaded
>>>> 
>>>> I am trying to extend log4j2.
>>>> 
>>>> I created my own configuration factory that is loaded just fine. 
>>>> In there I give it a default pattern with some new converters.
>>>> 
>>>> I created a converter with the needed annotations. However, seems 
>>>> that the plugin manager is not picking these up. Only plugins that 
>>>> exists in "" are actually loaded.
>>>> 
>>>> What am I missing?
>>>> 
>>>> Yair
>>>> 
>>>> 
>>>> ------------------------------------------------------------------
>>>> --
>>>> - To unsubscribe, e-mail: 
>>>> log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: 
>>>> log4j-user-help@logging.apache.org
>>>> 
>>>> 
>>>> ------------------------------------------------------------------
>>>> --
>>>> - To unsubscribe, e-mail: 
>>>> log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: 
>>>> log4j-user-help@logging.apache.org
>> B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>>   [  X  ܚX K  K[XZ[
>>       ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>>       ]\ \ Z [       [ ˘\ X  K ܙ B
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> --
> Matt Sicker <bo...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

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


RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
The manual still references the maven exec plugin. That should be removed, no?

My problem was that I didn't enable annotation processing in Intellij.

Works fine now, thanks.

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Matt Sicker [mailto:boards@gmail.com] 
Sent: Sunday, July 20, 2014 05:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

I updated the manual in regards to how to use the annotation processor if it doesn't work by default. It helps to compile your code using Maven, Gradle, Ant, or some other standard build tool rather than through the IDE.


On 17 July 2014 10:22, Yair Ogen (yaogen) <ya...@cisco.com> wrote:

> Please do share your example as I don't seem to get it to work for me.
>
> On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
> You were right, It was being skipped, I removed the pluging section 
> from the pom and the dat file gets generated all the same (I guess it 
> was through Java services mechanism) I think that I did not do a 
> proper build when I switched to 2.0 or somehow my jar was cached, it 
> looks fine now I can send you my small project if you wish I got  an 
> appender and a layout
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
> 17 de julio de 2014 16:30
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> Running mvn clean install fails for me:
>
> [WARNING]
> java.lang.Exception: The specified mainClass doesn't contain a main 
> method with appropriate signature.
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NoSuchMethodException:
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>         at java.lang.Class.getMethod(Class.java:1665)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>         ... 1 more
>
> Indeed no main method.  Perhaps you are not running with the released 
> 2.0 version?
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:21
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> Good question.
> Running mvn clean install my build does not inform of anything:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ----------------------------------------------------------------------
> -- [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
> ----------------------------------------------------------------------
> --
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
> com.globalavl.commons --- [INFO] [INFO] --- 
> maven-resources-plugin:2.6:resources (default-resources) @ 
> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ 
> com.globalavl.commons --- [WARNING] File encoding has not been set, 
> using platform encoding Cp1252, i.e. build is platform dependent!
> [INFO] Compiling 4 source files to
> C:\dev\com.globalavl.commons\target\classes
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources
> (default-testResources) @ com.globalavl.commons --- [WARNING] Using 
> platform encoding (Cp1252 actually) to copy filtered resources, i.e. 
> build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile 
> (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to 
> compile - all classes are up to date [INFO] [INFO] --- 
> maven-surefire-plugin:2.12.4:test (default-test) @ 
> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSH
> OT.jar
> [INFO]
> [INFO] --- maven-install-plugin:2.4:install (default-install) @ 
> com.globalavl.commons --- [INFO] Installing 
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSH
> OT.jar
> to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.co
> mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to 
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.co
> mmons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] BUILD SUCCESS
> [INFO]
> ----------------------------------------------------------------------
> --
> [INFO] Total time: 2.092s
> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
> 16M/219M [INFO]
> ----------------------------------------------------------------------
> --
>
> Pom part:
>
>                                 <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>exec-maven-plugin</artifactId>
>                                         <version>1.2.1</version>
>                                         <executions>
>                                                 <execution>
>
> <phase>process-classes</phase>
>                                                         <goals>
>
> <goal>java</goal>
>                                                         </goals>
>                                                 </execution>
>                                         </executions>
>                                         <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
>                                 </plugin>
>
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
> 17 de julio de 2014 16:16
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> How does it work? This class doesn't have a main?
>
> My mvn package run fails on:
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
> logging-log4j2: An exception occured while executing the Java class. 
> The specified mainClass doesn't contain a main method with appropriate 
> signature.
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
> .main([Ljava.lang.String;)
> -> [Help 1]
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:12
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> You are ritght, It Works with
>                                 <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration> And generates 
> the dat file in META-INF
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
> 17 de julio de 2014 16:09
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> I now see that the documentation is not up to date. The main class 
> should
> be:
>
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>
> as indicated in PluginManager:
>
>    /**
>      * Process annotated plugins.
>      * @deprecated Use {@link
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
> }
> instead. To do
>      * so, simply include {@code log4j-core} in your dependencies and 
> make sure annotation processing is not disabled.
>      * By default, supported Java compilers will automatically use 
> that plugin processor provided {@code log4j-core}
>      * is on the classpath.
>      */
>     @Deprecated // use PluginProcessor instead
>     public static void main(final String[] args) {
>         System.err.println("WARNING: this tool is superseded by the 
> annotation processor included in log4j-core.");
>         System.exit(-1);
>     }
>
> However, PluginProcessor doesn't contain a main...
>
> Catch 22?
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Yair Ogen (yaogen)
> Sent: Thursday, July 17, 2014 16:55
> To: 'Log4J Users List'
> Subject: RE: Converter Plugin not loaded
>
> I missed that.
>
> Added to my pom - should running mvn package be enough to generate the 
> file?
>
> It looks like it doesn't.
>
> I see this warning:
>
> WARNING: this tool is superseded by the annotation processor included 
> in log4j-core.
>
> And in the file system I have an empty directory:
>
> \target\generated-sources\annotations
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Thursday, July 17, 2014 16:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > In my case it find the *.dat file from core jar. Not clear how can 
> > we add more custom plugins.
> >
>
> Do you build with maven? The Plugin Preloading section < 
> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preload
> ing> on the Plugins page gives a sample snippet to add to your pom.xml 
> to make Maven generate the *.dat file for your plugins.
>
>
>
> > The same applies to my configuration plugin. I had to also use a 
> > ContextFactory and call start(new MyNewConfiguration()) manually for 
> > the custom configuration to work.
> >
> > Something in the plugin mechanism is not extension friendly.
> >
> > Best Regards,
> >
> > Yair Ogen
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 16:20
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I will try to do it bw today and tomorrow.
> > From what I see in code in pluginmanager:
> >
> >     private static PluginRegistry<PluginType<?>> decode(final 
> > ResourceLoader loader) {
> >         final Enumeration<URL> resources;
> >         try {
> >             resources =
> > loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
> >             if (resources == null) {
> >                 return null;
> >             }
> >         } catch (final IOException ioe) {
> >             LOGGER.warn("Unable to preload plugins", ioe);
> >             return null;
> >         }
> >         final PluginRegistry<PluginType<?>> map = new 
> > PluginRegistry<PluginType<?>>();
> >         while (resources.hasMoreElements()) {
> >
> > It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> > resources.hasMoreElements() == false
> >
> > Probably a classloading issue since 
> > PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file
> >
> >
> > -----Mensaje original-----
> > De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 
> > 17 de julio de 2014 15:03
> > Para: Log4J Users List
> > Asunto: Re: Converter Plugin not loaded
> >
> > Would it be possible to provide a small sample project that 
> > demonstrates the problem?
> > You may want to create a Jira ticket to attach files to (the mailing 
> > list software does not like attachments).
> >
> > Remko
> >
> >
> > On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> > <ya...@cisco.com>
> > wrote:
> >
> > > Just recently joined the mailing list - can you please share?
> > >
> > > Yair
> > >
> > > -----Original Message-----
> > > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > > Sent: Thursday, July 17, 2014 15:59
> > > To: Log4J Users List
> > > Subject: RE: Converter Plugin not loaded
> > >
> > > I think it is related to my issue (previous email)
> > >
> > > -----Mensaje original-----
> > > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: 
> > > jueves,
> > > 17 de julio de 2014 14:43
> > > Para: log4j-user@logging.apache.org
> > > Asunto: Converter Plugin not loaded
> > >
> > > I am trying to extend log4j2.
> > >
> > > I created my own configuration factory that is loaded just fine. 
> > > In there I give it a default pattern with some new converters.
> > >
> > > I created a converter with the needed annotations. However, seems 
> > > that the plugin manager is not picking these up. Only plugins that 
> > > exists in "" are actually loaded.
> > >
> > > What am I missing?
> > >
> > > Yair
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: 
> > > log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: 
> > > log4j-user-help@logging.apache.org
> > >
> > >
> > > ------------------------------------------------------------------
> > > --
> > > - To unsubscribe, e-mail: 
> > > log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: 
> > > log4j-user-help@logging.apache.org
> > >
> > >
> >
>  B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>    [  X  ܚX K  K[XZ[
>        ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>        ]\ \ Z [       [ ˘\ X  K ܙ B
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


--
Matt Sicker <bo...@gmail.com>

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


Re: Converter Plugin not loaded

Posted by Matt Sicker <bo...@gmail.com>.
I updated the manual in regards to how to use the annotation processor if
it doesn't work by default. It helps to compile your code using Maven,
Gradle, Ant, or some other standard build tool rather than through the IDE.


On 17 July 2014 10:22, Yair Ogen (yaogen) <ya...@cisco.com> wrote:

> Please do share your example as I don't seem to get it to work for me.
>
> On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
> You were right, It was being skipped, I removed the pluging section from
> the pom and the dat file gets generated all the same (I guess it was
> through Java services mechanism)
> I think that I did not do a proper build when I switched to 2.0 or somehow
> my jar was cached, it looks fine now
> I can send you my small project if you wish I got  an appender and a layout
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com]
> Enviado el: jueves, 17 de julio de 2014 16:30
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> Running mvn clean install fails for me:
>
> [WARNING]
> java.lang.Exception: The specified mainClass doesn't contain a main method
> with appropriate signature.
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
>         at java.lang.Thread.run(Thread.java:744)
> Caused by: java.lang.NoSuchMethodException:
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
>         at java.lang.Class.getMethod(Class.java:1665)
>         at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
>         ... 1 more
>
> Indeed no main method.  Perhaps you are not running with the released 2.0
> version?
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:21
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> Good question.
> Running mvn clean install my build does not inform of anything:
>
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO]
> ------------------------------------------------------------------------
> [INFO]
> [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @
> com.globalavl.commons --- [INFO] [INFO] ---
> maven-resources-plugin:2.6:resources (default-resources) @
> com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252
> actually) to copy filtered resources, i.e. build is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @
> com.globalavl.commons --- [WARNING] File encoding has not been set, using
> platform encoding Cp1252, i.e. build is platform dependent!
> [INFO] Compiling 4 source files to
> C:\dev\com.globalavl.commons\target\classes
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources
> (default-testResources) @ com.globalavl.commons --- [WARNING] Using
> platform encoding (Cp1252 actually) to copy filtered resources, i.e. build
> is platform dependent!
> [INFO] Copying 0 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @
> com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to
> date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @
> com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar
> (default-jar) @ com.globalavl.commons --- [INFO] Building jar:
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO]
> [INFO] --- maven-install-plugin:2.4:install (default-install) @
> com.globalavl.commons --- [INFO] Installing
> C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
> [INFO] Installing C:\dev\com.globalavl.commons\pom.xml to
> C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2.092s
> [INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory:
> 16M/219M [INFO]
> ------------------------------------------------------------------------
>
> Pom part:
>
>                                 <plugin>
>
> <groupId>org.codehaus.mojo</groupId>
>
> <artifactId>exec-maven-plugin</artifactId>
>                                         <version>1.2.1</version>
>                                         <executions>
>                                                 <execution>
>
> <phase>process-classes</phase>
>                                                         <goals>
>
> <goal>java</goal>
>                                                         </goals>
>                                                 </execution>
>                                         </executions>
>                                         <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
>                                 </plugin>
>
>
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:16
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> How does it work? This class doesn't have a main?
>
> My mvn package run fails on:
>
> [ERROR] Failed to execute goal
> org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project
> logging-log4j2: An exception occured while executing the Java class. The
> specified mainClass doesn't contain a main method with appropriate
> signature.
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
> -> [Help 1]
>
> Best Regards,
>
> Yair Ogen
> W: (+972) (0) 2-589-4919
> M: (+972) (0) 54-566-4919
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 17:12
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> You are ritght, It Works with
>                                 <configuration>
>
> <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
>                                                 <arguments>
>
> <argument>${project.build.outputDirectory}</argument>
>
> <argument>com.globalavl.commons.log4j</argument>
>                                                 </arguments>
>                                         </configuration>
> And generates the dat file in META-INF
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 16:09
> Para: Log4J Users List
> Asunto: RE: Converter Plugin not loaded
>
> I now see that the documentation is not up to date. The main class should
> be:
>
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor
>
> as indicated in PluginManager:
>
>    /**
>      * Process annotated plugins.
>      * @deprecated Use {@link
> org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor}
> instead. To do
>      * so, simply include {@code log4j-core} in your dependencies and make
> sure annotation processing is not disabled.
>      * By default, supported Java compilers will automatically use that
> plugin processor provided {@code log4j-core}
>      * is on the classpath.
>      */
>     @Deprecated // use PluginProcessor instead
>     public static void main(final String[] args) {
>         System.err.println("WARNING: this tool is superseded by the
> annotation processor included in log4j-core.");
>         System.exit(-1);
>     }
>
> However, PluginProcessor doesn't contain a main...
>
> Catch 22?
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Yair Ogen (yaogen)
> Sent: Thursday, July 17, 2014 16:55
> To: 'Log4J Users List'
> Subject: RE: Converter Plugin not loaded
>
> I missed that.
>
> Added to my pom - should running mvn package be enough to generate the
> file?
>
> It looks like it doesn't.
>
> I see this warning:
>
> WARNING: this tool is superseded by the annotation processor included in
> log4j-core.
>
> And in the file system I have an empty directory:
>
> \target\generated-sources\annotations
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Remko Popma [mailto:remko.popma@gmail.com]
> Sent: Thursday, July 17, 2014 16:30
> To: Log4J Users List
> Subject: Re: Converter Plugin not loaded
>
> On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
> wrote:
>
> > In my case it find the *.dat file from core jar. Not clear how can we
> > add more custom plugins.
> >
>
> Do you build with maven? The Plugin Preloading section <
> http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
> on the Plugins page gives a sample snippet to add to your pom.xml to make
> Maven generate the *.dat file for your plugins.
>
>
>
> > The same applies to my configuration plugin. I had to also use a
> > ContextFactory and call start(new MyNewConfiguration()) manually for
> > the custom configuration to work.
> >
> > Something in the plugin mechanism is not extension friendly.
> >
> > Best Regards,
> >
> > Yair Ogen
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 16:20
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I will try to do it bw today and tomorrow.
> > From what I see in code in pluginmanager:
> >
> >     private static PluginRegistry<PluginType<?>> decode(final
> > ResourceLoader loader) {
> >         final Enumeration<URL> resources;
> >         try {
> >             resources =
> > loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
> >             if (resources == null) {
> >                 return null;
> >             }
> >         } catch (final IOException ioe) {
> >             LOGGER.warn("Unable to preload plugins", ioe);
> >             return null;
> >         }
> >         final PluginRegistry<PluginType<?>> map = new
> > PluginRegistry<PluginType<?>>();
> >         while (resources.hasMoreElements()) {
> >
> > It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> > resources.hasMoreElements() == false
> >
> > Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE
> > exists on the jar file
> >
> >
> > -----Mensaje original-----
> > De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17
> > de julio de 2014 15:03
> > Para: Log4J Users List
> > Asunto: Re: Converter Plugin not loaded
> >
> > Would it be possible to provide a small sample project that
> > demonstrates the problem?
> > You may want to create a Jira ticket to attach files to (the mailing
> > list software does not like attachments).
> >
> > Remko
> >
> >
> > On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen)
> > <ya...@cisco.com>
> > wrote:
> >
> > > Just recently joined the mailing list - can you please share?
> > >
> > > Yair
> > >
> > > -----Original Message-----
> > > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > > Sent: Thursday, July 17, 2014 15:59
> > > To: Log4J Users List
> > > Subject: RE: Converter Plugin not loaded
> > >
> > > I think it is related to my issue (previous email)
> > >
> > > -----Mensaje original-----
> > > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > > 17 de julio de 2014 14:43
> > > Para: log4j-user@logging.apache.org
> > > Asunto: Converter Plugin not loaded
> > >
> > > I am trying to extend log4j2.
> > >
> > > I created my own configuration factory that is loaded just fine. In
> > > there I give it a default pattern with some new converters.
> > >
> > > I created a converter with the needed annotations. However, seems
> > > that the plugin manager is not picking these up. Only plugins that
> > > exists in "" are actually loaded.
> > >
> > > What am I missing?
> > >
> > > Yair
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> > > --------------------------------------------------------------------
> > > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > > For additional commands, e-mail: log4j-user-help@logging.apache.org
> > >
> > >
> >
>  B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB
>    [  X  ܚX K  K[XZ[
>        ]\ \ ][  X  ܚX P     [ ˘\ X  K ܙ B  ܈ Y  ] [ۘ[    [X[     K[XZ[
>        ]\ \ Z [       [ ˘\ X  K ܙ B
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Matt Sicker <bo...@gmail.com>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
Please do share your example as I don't seem to get it to work for me.

On Jul 17, 2014 6:16 PM, Jaime Sastre <js...@globalavl.com> wrote:
You were right, It was being skipped, I removed the pluging section from the pom and the dat file gets generated all the same (I guess it was through Java services mechanism)
I think that I did not do a proper build when I switched to 2.0 or somehow my jar was cached, it looks fine now
I can send you my small project if you wish I got  an appender and a layout


-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com]
Enviado el: jueves, 17 de julio de 2014 16:30
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

Running mvn clean install fails for me:

[WARNING]
java.lang.Exception: The specified mainClass doesn't contain a main method with appropriate signature.
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoSuchMethodException: org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
        at java.lang.Class.getMethod(Class.java:1665)
        at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
        ... 1 more

Indeed no main method.  Perhaps you are not running with the released 2.0 version?

Best Regards,

Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:21
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

Good question.
Running mvn clean install my build does not inform of anything:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.globalavl.commons --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ com.globalavl.commons --- [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\dev\com.globalavl.commons\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ com.globalavl.commons --- [INFO] Building jar: C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ com.globalavl.commons --- [INFO] Installing C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\dev\com.globalavl.commons\pom.xml to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.092s
[INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory: 16M/219M [INFO] ------------------------------------------------------------------------

Pom part:

                                <plugin>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>exec-maven-plugin</artifactId>
                                        <version>1.2.1</version>
                                        <executions>
                                                <execution>
                                                        <phase>process-classes</phase>
                                                        <goals>
                                                                <goal>java</goal>
                                                        </goals>
                                                </execution>
                                        </executions>
                                        <configuration>
                                                <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
                                                <arguments>
                                                        <argument>${project.build.outputDirectory}</argument>
                                                        <argument>com.globalavl.commons.log4j</argument>
                                                </arguments>
                                        </configuration>
                                </plugin>



-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:16
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

How does it work? This class doesn't have a main?

My mvn package run fails on:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project logging-log4j2: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature. org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;) -> [Help 1]

Best Regards,

Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:12
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

You are ritght, It Works with
                                <configuration>
                                                <mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
                                                <arguments>
                                                        <argument>${project.build.outputDirectory}</argument>
                                                        <argument>com.globalavl.commons.log4j</argument>
                                                </arguments>
                                        </configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,

Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,

Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a
> ContextFactory and call start(new MyNewConfiguration()) manually for
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen)
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems
> > that the plugin manager is not picking these up. Only plugins that
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B

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


RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
You were right, It was being skipped, I removed the pluging section from the pom and the dat file gets generated all the same (I guess it was through Java services mechanism)
I think that I did not do a proper build when I switched to 2.0 or somehow my jar was cached, it looks fine now
I can send you my small project if you wish I got  an appender and a layout


-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] 
Enviado el: jueves, 17 de julio de 2014 16:30
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

Running mvn clean install fails for me:

[WARNING]
java.lang.Exception: The specified mainClass doesn't contain a main method with appropriate signature.
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoSuchMethodException: org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
	at java.lang.Class.getMethod(Class.java:1665)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
	... 1 more

Indeed no main method.  Perhaps you are not running with the released 2.0 version?

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:21
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

Good question.
Running mvn clean install my build does not inform of anything:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.globalavl.commons --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ com.globalavl.commons --- [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\dev\com.globalavl.commons\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ com.globalavl.commons --- [INFO] Building jar: C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ com.globalavl.commons --- [INFO] Installing C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\dev\com.globalavl.commons\pom.xml to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.092s
[INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory: 16M/219M [INFO] ------------------------------------------------------------------------

Pom part:

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.2.1</version>
					<executions>
						<execution>
							<phase>process-classes</phase>
							<goals>
								<goal>java</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
				</plugin>



-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:16
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

How does it work? This class doesn't have a main?

My mvn package run fails on:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project logging-log4j2: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature. org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;) -> [Help 1]

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:12
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

You are ritght, It Works with 					
				<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B 

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


RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
Running mvn clean install fails for me:

[WARNING] 
java.lang.Exception: The specified mainClass doesn't contain a main method with appropriate signature.
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:301)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NoSuchMethodException: org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;)
	at java.lang.Class.getMethod(Class.java:1665)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:285)
	... 1 more

Indeed no main method.  Perhaps you are not running with the released 2.0 version?

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com] 
Sent: Thursday, July 17, 2014 17:21
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

Good question.
Running mvn clean install my build does not inform of anything:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.globalavl.commons --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ com.globalavl.commons --- [WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\dev\com.globalavl.commons\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ com.globalavl.commons --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ com.globalavl.commons --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ com.globalavl.commons --- [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ com.globalavl.commons --- [INFO] Building jar: C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ com.globalavl.commons --- [INFO] Installing C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\dev\com.globalavl.commons\pom.xml to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.092s
[INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014 [INFO] Final Memory: 16M/219M [INFO] ------------------------------------------------------------------------

Pom part:

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.2.1</version>
					<executions>
						<execution>
							<phase>process-classes</phase>
							<goals>
								<goal>java</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
				</plugin>



-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:16
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

How does it work? This class doesn't have a main?

My mvn package run fails on:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project logging-log4j2: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature. org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;) -> [Help 1]

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:12
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

You are ritght, It Works with 					
				<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B 

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


RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
Good question.
Running mvn clean install my build does not inform of anything:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.globalavl.commons 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ com.globalavl.commons ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ com.globalavl.commons ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ com.globalavl.commons ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\dev\com.globalavl.commons\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ com.globalavl.commons ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ com.globalavl.commons ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ com.globalavl.commons ---
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ com.globalavl.commons ---
[INFO] Building jar: C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ com.globalavl.commons ---
[INFO] Installing C:\dev\com.globalavl.commons\target\com.globalavl.commons-0.0.1-SNAPSHOT.jar to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\dev\com.globalavl.commons\pom.xml to C:\Users\jsastre\.m2\repository\com\globalavl\commons\com.globalavl.commons\0.0.1-SNAPSHOT\com.globalavl.commons-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.092s
[INFO] Finished at: Thu Jul 17 16:22:41 CEST 2014
[INFO] Final Memory: 16M/219M
[INFO] ------------------------------------------------------------------------

Pom part:

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.2.1</version>
					<executions>
						<execution>
							<phase>process-classes</phase>
							<goals>
								<goal>java</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
				</plugin>



-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] 
Enviado el: jueves, 17 de julio de 2014 16:16
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

How does it work? This class doesn't have a main?

My mvn package run fails on:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project logging-log4j2: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature. org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;) -> [Help 1]

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 17:12
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

You are ritght, It Works with 					
				<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B 

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


RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
How does it work? This class doesn't have a main?

My mvn package run fails on:

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default) on project logging-log4j2: An exception occured while executing the Java class. The specified mainClass doesn't contain a main method with appropriate signature. org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor.main([Ljava.lang.String;) -> [Help 1]

Best Regards,
 
Yair Ogen
W: (+972) (0) 2-589-4919
M: (+972) (0) 54-566-4919

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com] 
Sent: Thursday, July 17, 2014 17:12
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

You are ritght, It Works with 					
				<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B 

RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
You are ritght, It Works with 					
				<configuration>
						<mainClass>org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor</mainClass>
						<arguments>
							<argument>${project.build.outputDirectory}</argument>
							<argument>com.globalavl.commons.log4j</argument>
						</arguments>
					</configuration>
And generates the dat file in META-INF

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] 
Enviado el: jueves, 17 de julio de 2014 16:09
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen)
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  X  ܚX KK[XZ[
    ]\ \ ][  X  ܚX P   [ ˘\X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
    ]\ \ Z[   [ ˘\X K ܙ B 

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
I now see that the documentation is not up to date. The main class should be:

org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor

as indicated in PluginManager:

   /**
     * Process annotated plugins.
     * @deprecated Use {@link org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor} instead. To do
     * so, simply include {@code log4j-core} in your dependencies and make sure annotation processing is not disabled.
     * By default, supported Java compilers will automatically use that plugin processor provided {@code log4j-core}
     * is on the classpath.
     */
    @Deprecated // use PluginProcessor instead
    public static void main(final String[] args) {
        System.err.println("WARNING: this tool is superseded by the annotation processor included in log4j-core.");
        System.exit(-1);
    }

However, PluginProcessor doesn't contain a main...

Catch 22?

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Yair Ogen (yaogen) 
Sent: Thursday, July 17, 2014 16:55
To: 'Log4J Users List'
Subject: RE: Converter Plugin not loaded

I missed that.

Added to my pom - should running mvn package be enough to generate the file?

It looks like it doesn't.

I see this warning:

WARNING: this tool is superseded by the annotation processor included in log4j-core.

And in the file system I have an empty directory:

\target\generated-sources\annotations

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Remko Popma [mailto:remko.popma@gmail.com]
Sent: Thursday, July 17, 2014 16:30
To: Log4J Users List
Subject: Re: Converter Plugin not loaded

On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we 
> add more custom plugins.
>

Do you build with maven? The Plugin Preloading section <http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a 
> ContextFactory and call start(new MyNewConfiguration()) manually for 
> the custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final 
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new 
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE 
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 
> de julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that 
> demonstrates the problem?
> You may want to create a Jira ticket to attach files to (the mailing 
> list software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) 
> <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In 
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems 
> > that the plugin manager is not picking these up. Only plugins that 
> > exists in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > --------------------------------------------------------------------
> > - To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

Re: Converter Plugin not loaded

Posted by Remko Popma <re...@gmail.com>.
On Thu, Jul 17, 2014 at 10:24 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> In my case it find the *.dat file from core jar. Not clear how can we add
> more custom plugins.
>

Do you build with maven? The Plugin Preloading section
<http://logging.apache.org/log4j/2.x/manual/plugins.html#Plugin_Preloading>
on the Plugins page gives a sample snippet to add to your pom.xml to make
Maven generate the *.dat file for your plugins.



> The same applies to my configuration plugin. I had to also use a
> ContextFactory and call start(new MyNewConfiguration()) manually for the
> custom configuration to work.
>
> Something in the plugin mechanism is not extension friendly.
>
> Best Regards,
>
> Yair Ogen
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 16:20
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I will try to do it bw today and tomorrow.
> From what I see in code in pluginmanager:
>
>     private static PluginRegistry<PluginType<?>> decode(final
> ResourceLoader loader) {
>         final Enumeration<URL> resources;
>         try {
>             resources =
> loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
>             if (resources == null) {
>                 return null;
>             }
>         } catch (final IOException ioe) {
>             LOGGER.warn("Unable to preload plugins", ioe);
>             return null;
>         }
>         final PluginRegistry<PluginType<?>> map = new
> PluginRegistry<PluginType<?>>();
>         while (resources.hasMoreElements()) {
>
> It cannot load PluginProcessor.PLUGIN_CACHE_FILE
> resources.hasMoreElements() == false
>
> Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE
> exists on the jar file
>
>
> -----Mensaje original-----
> De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 de
> julio de 2014 15:03
> Para: Log4J Users List
> Asunto: Re: Converter Plugin not loaded
>
> Would it be possible to provide a small sample project that demonstrates
> the problem?
> You may want to create a Jira ticket to attach files to (the mailing list
> software does not like attachments).
>
> Remko
>
>
> On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
> wrote:
>
> > Just recently joined the mailing list - can you please share?
> >
> > Yair
> >
> > -----Original Message-----
> > From: Jaime Sastre [mailto:jsastre@globalavl.com]
> > Sent: Thursday, July 17, 2014 15:59
> > To: Log4J Users List
> > Subject: RE: Converter Plugin not loaded
> >
> > I think it is related to my issue (previous email)
> >
> > -----Mensaje original-----
> > De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> > 17 de julio de 2014 14:43
> > Para: log4j-user@logging.apache.org
> > Asunto: Converter Plugin not loaded
> >
> > I am trying to extend log4j2.
> >
> > I created my own configuration factory that is loaded just fine. In
> > there I give it a default pattern with some new converters.
> >
> > I created a converter with the needed annotations. However, seems that
> > the plugin manager is not picking these up. Only plugins that exists
> > in "" are actually loaded.
> >
> > What am I missing?
> >
> > Yair
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
>

RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
Could you try changing to rc1? Just to see if something got broken after that

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] 
Enviado el: jueves, 17 de julio de 2014 15:24
Para: Log4J Users List
Asunto: RE: Converter Plugin not loaded

In my case it find the *.dat file from core jar. Not clear how can we add more custom plugins.
The same applies to my configuration plugin. I had to also use a ContextFactory and call start(new MyNewConfiguration()) manually for the custom configuration to work.

Something in the plugin mechanism is not extension friendly.

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com]
Sent: Thursday, July 17, 2014 16:20
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

I will try to do it bw today and tomorrow. 
From what I see in code in pluginmanager:

    private static PluginRegistry<PluginType<?>> decode(final ResourceLoader loader) {
        final Enumeration<URL> resources;
        try {
            resources = loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
            if (resources == null) {
                return null;
            }
        } catch (final IOException ioe) {
            LOGGER.warn("Unable to preload plugins", ioe);
            return null;
        }
        final PluginRegistry<PluginType<?>> map = new PluginRegistry<PluginType<?>>();
        while (resources.hasMoreElements()) {

It cannot load PluginProcessor.PLUGIN_CACHE_FILE
resources.hasMoreElements() == false

Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file


-----Mensaje original-----
De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 de julio de 2014 15:03
Para: Log4J Users List
Asunto: Re: Converter Plugin not loaded

Would it be possible to provide a small sample project that demonstrates the problem?
You may want to create a Jira ticket to attach files to (the mailing list software does not like attachments).

Remko


On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Just recently joined the mailing list - can you please share?
>
> Yair
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 15:59
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I think it is related to my issue (previous email)
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> 17 de julio de 2014 14:43
> Para: log4j-user@logging.apache.org
> Asunto: Converter Plugin not loaded
>
> I am trying to extend log4j2.
>
> I created my own configuration factory that is loaded just fine. In 
> there I give it a default pattern with some new converters.
>
> I created a converter with the needed annotations. However, seems that 
> the plugin manager is not picking these up. Only plugins that exists 
> in "" are actually loaded.
>
> What am I missing?
>
> Yair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
In my case it find the *.dat file from core jar. Not clear how can we add more custom plugins.
The same applies to my configuration plugin. I had to also use a ContextFactory and call start(new MyNewConfiguration()) manually for the custom configuration to work.

Something in the plugin mechanism is not extension friendly.

Best Regards,
 
Yair Ogen

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com] 
Sent: Thursday, July 17, 2014 16:20
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

I will try to do it bw today and tomorrow. 
From what I see in code in pluginmanager:

    private static PluginRegistry<PluginType<?>> decode(final ResourceLoader loader) {
        final Enumeration<URL> resources;
        try {
            resources = loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
            if (resources == null) {
                return null;
            }
        } catch (final IOException ioe) {
            LOGGER.warn("Unable to preload plugins", ioe);
            return null;
        }
        final PluginRegistry<PluginType<?>> map = new PluginRegistry<PluginType<?>>();
        while (resources.hasMoreElements()) {

It cannot load PluginProcessor.PLUGIN_CACHE_FILE
resources.hasMoreElements() == false

Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file


-----Mensaje original-----
De: Remko Popma [mailto:remko.popma@gmail.com] Enviado el: jueves, 17 de julio de 2014 15:03
Para: Log4J Users List
Asunto: Re: Converter Plugin not loaded

Would it be possible to provide a small sample project that demonstrates the problem?
You may want to create a Jira ticket to attach files to (the mailing list software does not like attachments).

Remko


On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Just recently joined the mailing list - can you please share?
>
> Yair
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 15:59
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I think it is related to my issue (previous email)
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves,
> 17 de julio de 2014 14:43
> Para: log4j-user@logging.apache.org
> Asunto: Converter Plugin not loaded
>
> I am trying to extend log4j2.
>
> I created my own configuration factory that is loaded just fine. In 
> there I give it a default pattern with some new converters.
>
> I created a converter with the needed annotations. However, seems that 
> the plugin manager is not picking these up. Only plugins that exists 
> in "" are actually loaded.
>
> What am I missing?
>
> Yair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
I will try to do it bw today and tomorrow. 
From what I see in code in pluginmanager:

    private static PluginRegistry<PluginType<?>> decode(final ResourceLoader loader) {
        final Enumeration<URL> resources;
        try {
            resources = loader.getResources(PluginProcessor.PLUGIN_CACHE_FILE);
            if (resources == null) {
                return null;
            }
        } catch (final IOException ioe) {
            LOGGER.warn("Unable to preload plugins", ioe);
            return null;
        }
        final PluginRegistry<PluginType<?>> map = new PluginRegistry<PluginType<?>>();
        while (resources.hasMoreElements()) {

It cannot load PluginProcessor.PLUGIN_CACHE_FILE
resources.hasMoreElements() == false

Probably a classloading issue since PluginProcessor.PLUGIN_CACHE_FILE exists on the jar file


-----Mensaje original-----
De: Remko Popma [mailto:remko.popma@gmail.com] 
Enviado el: jueves, 17 de julio de 2014 15:03
Para: Log4J Users List
Asunto: Re: Converter Plugin not loaded

Would it be possible to provide a small sample project that demonstrates the problem?
You may want to create a Jira ticket to attach files to (the mailing list software does not like attachments).

Remko


On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Just recently joined the mailing list - can you please share?
>
> Yair
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 15:59
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I think it is related to my issue (previous email)
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 
> 17 de julio de 2014 14:43
> Para: log4j-user@logging.apache.org
> Asunto: Converter Plugin not loaded
>
> I am trying to extend log4j2.
>
> I created my own configuration factory that is loaded just fine. In 
> there I give it a default pattern with some new converters.
>
> I created a converter with the needed annotations. However, seems that 
> the plugin manager is not picking these up. Only plugins that exists 
> in "" are actually loaded.
>
> What am I missing?
>
> Yair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: Converter Plugin not loaded

Posted by Remko Popma <re...@gmail.com>.
Would it be possible to provide a small sample project that demonstrates
the problem?
You may want to create a Jira ticket to attach files to (the mailing list
software does not like attachments).

Remko


On Thu, Jul 17, 2014 at 10:00 PM, Yair Ogen (yaogen) <ya...@cisco.com>
wrote:

> Just recently joined the mailing list - can you please share?
>
> Yair
>
> -----Original Message-----
> From: Jaime Sastre [mailto:jsastre@globalavl.com]
> Sent: Thursday, July 17, 2014 15:59
> To: Log4J Users List
> Subject: RE: Converter Plugin not loaded
>
> I think it is related to my issue (previous email)
>
> -----Mensaje original-----
> De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17
> de julio de 2014 14:43
> Para: log4j-user@logging.apache.org
> Asunto: Converter Plugin not loaded
>
> I am trying to extend log4j2.
>
> I created my own configuration factory that is loaded just fine. In there
> I give it a default pattern with some new converters.
>
> I created a converter with the needed annotations. However, seems that the
> plugin manager is not picking these up. Only plugins that exists in "" are
> actually loaded.
>
> What am I missing?
>
> Yair
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

RE: Converter Plugin not loaded

Posted by "Yair Ogen (yaogen)" <ya...@cisco.com>.
Just recently joined the mailing list - can you please share?

Yair 

-----Original Message-----
From: Jaime Sastre [mailto:jsastre@globalavl.com] 
Sent: Thursday, July 17, 2014 15:59
To: Log4J Users List
Subject: RE: Converter Plugin not loaded

I think it is related to my issue (previous email)

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] Enviado el: jueves, 17 de julio de 2014 14:43
Para: log4j-user@logging.apache.org
Asunto: Converter Plugin not loaded

I am trying to extend log4j2.

I created my own configuration factory that is loaded just fine. In there I give it a default pattern with some new converters.

I created a converter with the needed annotations. However, seems that the plugin manager is not picking these up. Only plugins that exists in "" are actually loaded.

What am I missing?

Yair


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


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


RE: Converter Plugin not loaded

Posted by Jaime Sastre <js...@globalavl.com>.
I think it is related to my issue (previous email)

-----Mensaje original-----
De: Yair Ogen (yaogen) [mailto:yaogen@cisco.com] 
Enviado el: jueves, 17 de julio de 2014 14:43
Para: log4j-user@logging.apache.org
Asunto: Converter Plugin not loaded

I am trying to extend log4j2.

I created my own configuration factory that is loaded just fine. In there I give it a default pattern with some new converters.

I created a converter with the needed annotations. However, seems that the plugin manager is not picking these up. Only plugins that exists in "" are actually loaded.

What am I missing?

Yair


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