问题
I use a project template containing a Maven configuration for an embedded Glassfish (using the maven-embedded-glassfish-plugin). I need to enable logging, but I do not even know which logging engine is enabled in the Glassfish (since I did not create the template).
The template uses slf4j-log4j12 as a dependency, but I am not sure if slf4j or java.util.logging does the actual logging. Therefore I created two logging files, one logging.properties
and one log4j.properties
and put them both to src/main/resources
and /src/main/resources/META-INF
, which both does not seem to work.
I added java.util.logging.config.file=logging.properties
to the Maven Glassfish system properties (also for log4j), and also this did not work out. I checked, that the properties files are in the JAR file.
How can I determine which backend is responsible for logging?
How can I specify a logging configuration for embedded Glassfish using the Maven embedded Glassfish plugin?
Currently I get logging output at level INFO on default out. I guess this is the default setting.
来源:https://stackoverflow.com/questions/16335091/specify-logging-properties-in-embedded-glassfish-with-maven-embedded-glassfish-p