简体   繁体   English

如何配置嵌入式Jetty服务器以将NCSARequestLog打印到STDOUT

[英]How do I configure embedded Jetty server to print NCSARequestLog to STDOUT

I have an embedded Jetty server running on Heroku, and I want it to print request logs to STDOUT so I can capture device, IP, etc data. 我有一个在Heroku上运行的嵌入式Jetty服务器,我希望它将请求日志打印到STDOUT,这样我就可以捕获设备,IP等数据。

I can see how to configure NCSARequestLog to log to a file , but I can't find any way to redirect that to STDOUT. 我可以看到如何配置NCSARequestLog以记录到文件 ,但我找不到任何方法将其重定向到STDOUT。

How can I log request information from an embedded Jetty server to STDOUT? 如何将嵌入式Jetty服务器的请求信息记录到STDOUT?

The NCSARequestLog does not output to console, and cannot be configured to do that. NCSARequestLog不会输出到控制台,也无法配置为执行此操作。

However, all is not lost, use the Slf4jRequestLog instead and setup your slf4j log implementation to output those events to your console. 但是,一切都没有丢失,请改用Slf4jRequestLog并设置slf4j日志实现,将这些事件输出到控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM