red5 1.0.0 rc1: configure logback to log errors from org.red5.server.service.ServiceInvoker
This is my logback configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<contextName>xpofacebook</contextName>
<appender name="ERROR"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/xpofacebook-error.log</File>
<Append>true</Append>
<BufferedIO>false</BufferedIO>
<ImmediateFlush>true</ImmediateFlush>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</Pattern>
</layout>
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>log/error.log.%i.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>3</MaxIndex>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>WARN</level>
</filter>
</appender>
<appender name="FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/xpofacebook-application.log</File>
<Append>true</Append>
<BufferedIO>false</BufferedIO>
<ImmediateFlush>true</ImmediateFlush>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%date{ISO8601} [%-5level] %logger{35} - %msg%n</Pattern>
</layout>
<rollingPolicy
class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<FileNamePattern>log/xpofacebook-application.log.%i.zip</FileNamePattern>
<MinIndex>1</MinIndex>
<MaxIndex>3</MaxIndex>
</rollingPolicy>
<triggeringPolicy
class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<MaxFileSize>5MB</MaxFileSize>
</triggeringPolicy>
</appender>
<root>
<level value="DEBUG" />
<appender-ref ref="ERROR" />
<appender-ref ref="FILE" />
</root>
</configuration>
so far it works great i need to add the following code to each class that i want to log messages in:
private static Logger log = Red5LoggerFactory.getLogger(ClassName.class, "xpofacebook");
i want the main log file xpofacebook-application.log to log messages outside of the classes that i work with.
If a flex client is connected to the red5 server and is trying to invoke a command that does not exist, the f开发者_JAVA技巧ollowing error message will be show:
[NioProcessor-1] org.red5.server.service.ServiceInvoker - Method
getLiveChallenges with parameters [] not found in
com.xpogames.xpofacebook.Application@55e03a61
How can i make sure that these type of error messages will be included in my log file as well?
This will take a change in the core logging functionality of Red5. Right now the stuff outside your application is controlled by a different logger because they fall within a classloader above yours. Without getting into the fun of Java classloaders here, I will simply say that a fix or workaround will eventually come.
精彩评论