项目里日志升级到log4j2 后输出日志到日志系统就不行了,求大神指点一下
log4j2.xml配置:
<configuration status="info"> <Socket name="socket" host="10.1.21.1" port="4567" > <SerializedLayout /> </Socket> </appenders> <loggers> <logger name="com.test" level="info"></logger> <Root level="info"> <AppenderRef ref="socket"/> </Root> </loggers> </configuration>
错误异常:
2016-12-16 11:34:40,503 AsyncAppender-Async ERROR Unable to write to stream TCP:10.1.21.1:4567 for appender socket: org.apache.logging.log4j.core.appender.AppenderLoggingException: Error writing to TCP:10.1.21.1:4567 2016-12-16 11:34:40,506 AsyncAppender-Async ERROR An exception occurred processing Appender socket org.apache.logging.log4j.core.appender.AppenderLoggingException: Error writing to TCP:10.1.21.1:4567 at org.apache.logging.log4j.core.net.TcpSocketManager.write(TcpSocketManager.java:143) at org.apache.logging.log4j.core.appender.OutputStreamManager.write(OutputStreamManager.java:197) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.writeByteArrayToManager(AbstractOutputStreamAppender.java:185) at org.apache.logging.log4j.core.appender.SocketAppender.directEncodeEvent(SocketAppender.java:424) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160) at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156) at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129) at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84) at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.callAppenders(AsyncAppender.java:451) at org.apache.logging.log4j.core.appender.AsyncAppender$AsyncThread.run(AsyncAppender.java:404) Caused by: java.net.SocketException: Broken pipe at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153) at org.apache.logging.log4j.core.net.TcpSocketManager.write(TcpSocketManager.java:133)
遇到同样的问题了,请问解决了吗?没有搞定!!然后用flume了
logstash没有集成log4j2插件,集成下插件配置下想关配置就可以了。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。