I'm running a java webapp with a simple mvn jetty:run
, using the latest jetty plugin, but I can't seem to find a way to tell jetty to output DEBUG messages to console (for the embedded jetty instance, not the plugin itself). It's currently outputting only WARN and INFO messages. I've tried setting -DDEBUG
and -DVERBOSE
, but they don't do anything. I've already had a look at the documentation, but it doesn't seem to cover this.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I find this solution more convenient
also don't forget paste
for resources plugin
You can also do this "mvn -X jetty:run"
To extend Pascal's answer, this is how it works with log4j:
This is your
${project.basedir}/src/test/resources/log4j.properties
:Additional resources:
To extend Pascal's and yegor256's answer, this is how it works with
SLF4J Simple logger
(which is the most easiest option since you just need to add a dependency toslf4j-simple
):It is possible to configure the SLF4J Logger directly from Maven pom. Defaults are described in http://www.slf4j.org/apidocs/org/slf4j/impl/SimpleLogger.html)
For instance, log into a file
/tmp/output.log
with higher debug level (TRACE
):Update: OK, I finally got things working and here is what I did.
My understanding is that Jetty 7 doesn't have any dependencies on a particular logging framework, even for the JSP engine since Jetty 7 uses the JSP 2.1 engine. So you can use any logging framework. Here I will use logback.
First add
logback-classic
as dependency in the plugin and set thelogback.configurationFile
system property to point on a configuration file:Then add a
src/etc/logback.xml
configuration file. Below a minimal configuration:With this setup, jetty will output DEBUG messages:
Resources: