如何配置logback以将日志消息发送到远程服务器appender?
例如,在log4j中,我可以在log4j属性文件中使用以下内容。
log4j.rootLogger=server
# Redirect logs
log4j.appender.server=org.apache.log4j.net.SocketAppender
log4j.appender.server.Port=3501
log4j.appender.server.RemoteHost=127.0.0.1
log4j.appender.server.ReconnectionDelay=30000
答案 0 :(得分:0)
找到它,
<configuration>
<appender name="SOCKET" class="ch.qos.logback.classic.net.SocketAppender">
<remoteHost>${host}</remoteHost>
<port>${port}</port>
<reconnectionDelay>10000</reconnectionDelay>
<includeCallerData>${includeCallerData}</includeCallerData>
</appender>
<root level="DEBUG">
<appender-ref ref="SOCKET" />
</root>
</configuration>