How do I get jetty to turn down the level of logging from the default of INFO?
I'm actually trying to run the default Apache Solr installation, which ships with jetty, but dumps a lot of information to the console, and I'd only like to see warnings.
I don't want to go hack up the code, I just would like to be able to drop a config file somewhere, but I've been googling for a while, and all I find are obsolete methods or programmatic methods.
Thanks!
edit: -D options would be great, too!
You can configure Jetty Request logging by adding something similar to the following at the end of the jetty. xml file (located in the /path/to/idm/conf directory): IDM 6.5 and later: <Set name="requestLog"> <New id="RequestLog" class="org. eclipse.
last modified July 15, 2022. Logging is recording the activity of a program during its lifetime. Logging is used for problem diagnosis, auditing, debugging, or information gathering. There are several logging frameworks available in Java. If we do not specify a logging framework, Jetty defaults to its built-in org.
Jetty's default configuration is based on two properties: jetty.home The property that defines the location of the jetty distribution, its libs, default modules and default XML files (typically start.jar, lib, etc) jetty.base The property that defines the location of a specific instance of a jetty server, its ...
Short answer: java -DDEBUG -jar start.jar
Long answer: (taken from http://docs.codehaus.org/display/JETTY/Debugging)
"Jetty has it's own builtin logging facade that can log to stderr or slf4j (which in turn can log to commons logging, log4j, nlog4j and java logging). Jetty logging looks for a slf4j jar on the classpath. If found, slf4j is used to control logging otherwise stderr is used. The org.mortbay.log.Log class is used to coordinate logging and the following system parameters may be used to control logging:"
org.mortbay.log.class
: Specify an implementation of org.mortbay.log.Logger
to use
DEBUG
: If set, debug logs will be produced, else only INFO
and WARN
logs will be generated
VERBOSE
: If set, verbose logging is produced, including ignored exceptions
IGNORED
: If set (jetty 6.1.10 and later), ignored exceptions are logged (independent of DEBUG
and VERBOSE
settings
Here I undestand that by the "system parameters", in the above cited text, they mean "Java system properties".
If you run jetty 6 as a daemon, the logging config file is:
/usr/share/jetty/resources/log4j.properties
(Where /usr/share/jetty
is your $jetty.home
.) And to turn down the default log level in that log4jproperties
file, change the rootLogger
entry:
log4j.rootLogger=WARN, stdout
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With