views:

373

answers:

3

Hi...

I´m using glassfishv3 for few days. But i don´t know how to get log4j working with the v3.

In glassfishv2 there was a "System Classpath" field which you could used in order to point to your log4j.properties file.

But in glassfishv3 "System Classpath" is not supported any more.

So where i have to put the log4j.properties file on glassfishv3???

Thanks

A: 

By default, log4j.properties is located in the root of the classpath. You can override this location by setting the log4j.configuration system property, e.g.

-Dlog4j.configuration=my/path/to/log4j.properties

So then it can reside anywhere in the classpath you like.

As to how to set system properties in glassfish, I have no idea, but it can't be that hard.

skaffman
hmm... thanks for your answer skaffman. I´ve try it out. But after restart of the server there is still the warning "log4j:WARN Please initialize the log4j system properly."
Jackson
A: 

It works when i copy the log4j.properties file into the /opt/glassfishv3/glassfish/domains/domain1/lib/classes folder.

Then it is in the classpath ;)

Jackson
A: 

Hi Jackson - could you please write how did you make Log4j to work under GFv3 ? I uploaded the lib of log4j under /lib and tried to put the properties file in classpath and aslo use system properties. Nothing works yet.

Thanks

JacQ