English 中文(简体)
Glassfishv3 and log4j
原标题:

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

最佳回答

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.

问题回答

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 ;)





相关问题
Best logging approach for composite app?

I am creating a Composite WPF (Prism) app with several different projects (Shell, modules, and so on). I am getting ready to implement logging, using Log4Net. It seems there are two ways to set up the ...

How to make logging.debug work on Appengine?

I m having a tough time getting the logging on Appengine working. the statement import logging is flagged as an unrecognized import in my PyDev Appengine project. I suspected that this was just an ...

How to validate Java logging properties files?

I have a basic facility for allowing users to remotely apply changes to the logging files in my application. Some logs are configured using java.util.logging properties files, and some are configured ...

Logging SAS scripts

I ve been developing a lot of Java, PHP and Python. All of which offer great logging packages (Log4J, Log or logging respectively). This is a great help when debugging applications. Especially if the ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

热门标签