开发者

how to configure jetty 7 to use syslog or log4j

I am looking for a way to dir开发者_如何学Cect 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜