Red5:记录外部库

时间:2011-04-07 08:16:46

标签: logging red5 slf4j

鉴于:Red5 0.8.RC3,使用库(.jar)的应用程序(.war)。

应用程序使用slf4j进行日志记录,所有记录器都实例化如下:

private static Logger log = Red5LoggerFactory.getLogger(MyClass.class, "webcall"); //"webcall" is a context name

日志记录的配置文件:logback-webcall.xml

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<contextName>webcall</contextName>

<jmxConfigurator contextName="webcall" />

<appender name="WEBCALL" class="ch.qos.logback.core.FileAppender">
    <File>/var/log/lx/webcall.log</File>
    <Append>false</Append>
    <Encoding>UTF-8</Encoding>
    <BufferedIO>false</BufferedIO>
    <ImmediateFlush>true</ImmediateFlush>
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>
            %date [%thread] %-5level %logger{35} - %msg%n
        </Pattern>
    </layout>
</appender>
<root>
    <level value="DEBUG" /> 
    <appender-ref ref="WEBCALL" />
</root>
</configuration>

那个适用于所有记录器,如上所述实例化。但是在(它没有关于Red5LoggerFactory和上下文的线索)中,记录器实例化如下:

private static Logger log = LoggerFactory.getLogger(MyLibraryClass.class); //org.slf4j.LoggerFactory;

他们不工作。

问题:如何为Red5服务器配置库内的日志记录?

1 个答案:

答案 0 :(得分:0)

解决方案是在red5 / conf / logback.xml中配置日志记录

相关问题