Вопрос по java – Как включить отладку в логгере slf4j?

30

Error: User Rate Limit ExceededdebugError: User Rate Limit Exceededslf4j.LoggerError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded missingfaktor
Error: User Rate Limit Exceeded Thorbjørn Ravn Andersen

Ваш Ответ

6   ответов
1

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">

<!-- ============================== -->
<!-- Append messages to the console -->
<!-- ============================== -->

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out"/>
    <param name="Threshold" value="INFO"/>

    <layout class="org.apache.log4j.PatternLayout">
        <!-- The default pattern: Date Priority [Category] Message\n -->
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
    </layout>
</appender>

<appender name="web" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="Threshold" value="DEBUG"/>
    <param name="Append" value="true"/>
    <param name="File" value="${catalina.home}/logs/web.log"/>
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
    </layout>
</appender>

<category name="com.idc.scd" additivity="false">
    <priority value="${log4j.category.com.mypackage}"/>
    <appender-ref ref="web"/>
</category>

</log4j:configuration>

Error: User Rate Limit Exceeded missingfaktor
Error: User Rate Limit Exceeded missingfaktor
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
7


Using slf4j with Log4j logger
src/main/resources/log4j.properties

log4j.rootLogger=DEBUG, STDOUT
log4j.logger.deng=INFO
log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
log4j.appender.STDOUT.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
Error: User Rate Limit Exceededpackage deng;Error: User Rate Limit Exceededlog4j.logger.org.faceless.product.magic=INFOError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
0

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
  <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
    <param name="Target" value="System.out" />
    <param name="Threshold" value="DEBUG" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{1}] %m%n" />
    </layout>
  </appender>
  <root>
    <appender-ref ref="CONSOLE" />
  </root>
</log4j:configuration>
1

Error: User Rate Limit Exceeded missingfaktor
Error: User Rate Limit Exceededslf4j.org/faq.html#where_is_bindingError: User Rate Limit Exceeded
0

Error: User Rate Limit Exceeded
12

setLoggingLevel(ch.qos.logback.classic.Level.DEBUG);

public static void setLoggingLevel(ch.qos.logback.classic.Level level) {
    ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) org.slf4j.LoggerFactory.getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
    root.setLevel(level);
}
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded

Похожие вопросы