它与Logback-SLF4J兼容的rsyslog吗?

问题描述

我正在使用spring-boot-starter-web之类的框架。这些,使用Logback(不实现其他库)来使用SLF4J(如外观)来管理日志。我需要将其与rsyslog一起使用,但官方文档仅引用了Syslog

我尝试使用Syslog implementation,因为Syslog继承了rsyslog,但没有找到(我在下面附加了logback-spring.xml)。

有什么主意吗?

<?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="30 seconds">
  <property resource="application.properties" />
   <!-- Syslog,make sure that syslog are enabled in the OS-->
     <appender name="RSYSLOG" class="ch.qos.logback.classic.net.SyslogAppender">
        <syslogHost>127.0.0.1</syslogHost>
        <facility>LOCAL0</facility>
        <port>514</port>
        <throwableExcluded>true</throwableExcluded>
        <suffixPattern>%package.yes.rest %m thread:%t priority:%p category:%c
            exception:%exception:%msg</suffixPattern>
     </appender>

  <logger name="package.yes.rest" level="info" additivity="false">
     <appender-ref ref="RSYSLOG"/>
  </logger>
 </configuration>

红利剪辑:我也看到了LogbackLog4j2的{​​{3}}变更,但使用继承Logback更为稳定。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)