custom logger/add jar to startup classpath

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

custom logger/add jar to startup classpath

Graeme
I have a NB Platform application, I've added:

 run.args.extra=-J-Djava.util.logging.config.file=jul.properties

to the suites project.properties file that registers a java.util.logging handler.
(I want all modules/libraries using java.util.logging to send to GrayLog server)

I'm getting the exception: (which I expected)

Can't load log handler "org.graylog2.logging.GelfHandler"
java.lang.ClassNotFoundException: org.graylog2.logging.GelfHandler

My question is how do I add a jar that is available at startup/that will work when passing a VM argument?  I'm familiar with wrapped libraries/module dependencies but this seems a little different.




Reply | Threaded
Open this post in threaded view
|

Re: custom logger/add jar to startup classpath

Jean-Marc Borer
Hello,

It is possible to add Jar on the global classpath at startup of netbeans. Try to add in your app.conf file: --cp:p <absolute path to a your jar>. This works for LaFs, so it should work for provided loggers too.

Hope it helps

JM


On Mon, Nov 23, 2015 at 5:20 AM, Graeme <[hidden email]> wrote:
I have a NB Platform application, I've added:

 run.args.extra=-J-Djava.util.logging.config.file=jul.properties

to the suites project.properties file that registers a java.util.logging handler.
(I want all modules/libraries using java.util.logging to send to GrayLog server)

I'm getting the exception: (which I expected)

Can't load log handler "org.graylog2.logging.GelfHandler"
java.lang.ClassNotFoundException: org.graylog2.logging.GelfHandler

My question is how do I add a jar that is available at startup/that will work when passing a VM argument?  I'm familiar with wrapped libraries/module dependencies but this seems a little different.





Reply | Threaded
Open this post in threaded view
|

Re: custom logger/add jar to startup classpath

Graeme

Thanks – that worked!  Exactly what I was looking for!

 

-Graeme

 

From: Jean-Marc Borer [mailto:[hidden email]]
Sent: Monday, November 23, 2015 3:34 AM
To: dev
Subject: [platform-dev] Re: custom logger/add jar to startup classpath

 

Hello,

It is possible to add Jar on the global classpath at startup of netbeans. Try to add in your app.conf file: --cp:p <absolute path to a your jar>. This works for LaFs, so it should work for provided loggers too.

Hope it helps

JM

 

On Mon, Nov 23, 2015 at 5:20 AM, Graeme <[hidden email]> wrote:

I have a NB Platform application, I've added:

 run.args.extra=-J-Djava.util.logging.config.file=jul.properties

to the suites project.properties file that registers a java.util.logging handler.
(I want all modules/libraries using java.util.logging to send to GrayLog server)

I'm getting the exception: (which I expected)

Can't load log handler "org.graylog2.logging.GelfHandler"
java.lang.ClassNotFoundException: org.graylog2.logging.GelfHandler

My question is how do I add a jar that is available at startup/that will work when passing a VM argument?  I'm familiar with wrapped libraries/module dependencies but this seems a little different.



 

Reply | Threaded
Open this post in threaded view
|

Re: custom logger/add jar to startup classpath

Jean-Marc Borer

On Tue, Nov 24, 2015 at 3:28 AM, Ingleby, Graeme <[hidden email]> wrote:

Thanks – that worked!  Exactly what I was looking for!

 

-Graeme

 

From: Jean-Marc Borer [mailto:[hidden email]]
Sent: Monday, November 23, 2015 3:34 AM
To: dev
Subject: [platform-dev] Re: custom logger/add jar to startup classpath

 

Hello,

It is possible to add Jar on the global classpath at startup of netbeans. Try to add in your app.conf file: --cp:p <absolute path to a your jar>. This works for LaFs, so it should work for provided loggers too.

Hope it helps

JM

 

On Mon, Nov 23, 2015 at 5:20 AM, Graeme <[hidden email]> wrote:

I have a NB Platform application, I've added:

 run.args.extra=-J-Djava.util.logging.config.file=jul.properties

to the suites project.properties file that registers a java.util.logging handler.
(I want all modules/libraries using java.util.logging to send to GrayLog server)

I'm getting the exception: (which I expected)

Can't load log handler "org.graylog2.logging.GelfHandler"
java.lang.ClassNotFoundException: org.graylog2.logging.GelfHandler

My question is how do I add a jar that is available at startup/that will work when passing a VM argument?  I'm familiar with wrapped libraries/module dependencies but this seems a little different.