0

我需要一个远程日志查看器,例如chainsawfor log4php。当我使用log4j时,电锯是我的第一选择,虽然log4php与 相同log4jchainsaw但反应不佳。

例如,我给了这个配置

log4php.appender.A3=LoggerAppenderSocket 
log4php.appender.A3.remoteHost=cin10050
log4php.appender.A3.port=4445
log4php.appender.A3.layout=LoggerLayoutXml

Chainsaw在中生成一条日志消息chainsaw-logs

Connection lost! :: invalid stream header: 3C6C6F67

有没有人有办法解决吗?

谢谢

4

1 回答 1

0

Chainsaw provides an XMLSocketReceiver, which could be used to receive events from log4php, but I don't think they send events in a format that the receiver can process.

I'd suggest logging to a regular text log file and using the latest developer snapshot of Chainsaw, available here: http://people.apache.org/~sdeboy

Use the 'File,Load Chainsaw configuration' option and select 'process a log file'. Then hit the 'open file' to browse to your log file location, and then specify your 'log file format'. A simple one that will always work is: MESSAGE

That format will just make the entire log line the 'message' field. If you'd like Chainsaw to parse your levels and timestamps etc, that's possible, you just need to use the keywords and match up your format.

Then, click the 'always start Chainsaw with this configuration' check box, and then hit the 'save configuration as' button and save your chainsaw configuration to something like log4php-chainsaw-config.xml.

When you hit ok, you should get a new tab with your log file contents.

Scott

于 2012-10-30T19:33:53.317 回答