Reputation: 11
I am looking for a way to direct all the jetty 7 logging to syslog. My current configuration dumps everything to JETTY_HOME/logs/.. After some initial ivestigation, it seems I should change JETTY_HOME/etc/jetty-logging.xml, but this does not look straightforward. It looks like I should create a new PrintStream implementation which sends its output to syslog and redirecting stderr and stdout to that class in jetty-logging.xml.
any easier way to do that or to make jetty log directly to log4j ?
Thanks
Upvotes: 1
Views: 3857
Reputation: 879
According to this advice by David Yu, it should be as simple as making org.slf4j.Logger available, which didn't work for me. However, in unix you could do something like
java ... -Djetty.home=/usr/share/jetty -Djava.io.tmpdir=/tmp \
-jar /usr/share/jetty/start.jar /usr/share/jetty/etc/jetty.xml 2>&1 |
logger -t jetty
In etc/jetty.xml, you may also want to comment out the line that calls RequestLogImpl.setFilename.
Upvotes: 1