Logging Level on Glassfish-3 JPA Eclipselink

2019-08-28 20:13发布

问题:

How do I setup a EAR and a Glassfish Server that it shows FINE level on the development server but the same ear shows INFO level on the productive machines?

In the moment I change config in the persistence.xml every time i deploy onto the productive machines. But s.t. i forget and the machine starts flooding the log files.

回答1:

You must put in the

    <jvm-options>-Declipselink.logging.level=FINE</jvm-options>

into your config.xml java-config tag on your development machine.

And do NOT put in the logging level property into the persistence.xml.



回答2:

You can also set the EclipseLink log level using System properties (or you could set the log level in code using a SessionCustomizer).