简体   繁体   中英

Spring WebFlow Project. I can't stop log4j from printing debug statements

I am working on a Spring WebFlow Project. I can't stop log4j from printing debug statements. can someone please tell me how to get it to stop putting debug statments on the console and log.

I see this warn as my server starts:

log4j:WARN Continuable parsing error 42 and column 11
log4j:WARN The content of element type "logger" must match "(level?,appender-ref*)".

Below is my log4j.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

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

    <appender name="console" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n" />
        </layout>
    </appender>


    <appender name="logfile" class="org.apache.log4j.FileAppender">
        <param name="File" value="logs/disater_relief.log" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n" />
        </layout>
    </appender>


    <appender name="rollinglogfile" class="org.apache.log4j.RollingFileAppender">
        <param name="file" value="logs/school_visit.log" />
        <param name="immediateFlush" value="true" />
        <param name="append" value="true" />
        <param name="maxFileSize" value="1MB" />
        <param name="maxBackupIndex" value="3" />

        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n" />
        </layout>

    </appender>

    <appender name="dailyrollinglogfile" class="org.apache.log4j.DailyRollingFileAppender">
        <param name="file" value="./logs/school_visit.log" />
        <param name="immediateFlush" value="true" />
        <param name="append" value="true" />
        <param name="datePattern" value=" '.' yyyy-MM-dd " />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n" />
        </layout>

    </appender>

    <appender name="email" class="org.apache.log4j.net.SMTPAppender">
        <param name="BufferSize" value="512" />
        <param name="SMTPHost" value="xxx" />
        <param name="From" value="xx" />
        <param name="To" value="xx" />
        <param name="Subject" value="School Visit Web - SYSTEM ERROR" />

        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %-5p %c - %m%n" />
        </layout>

        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            <param name="LevelMin" value="ERROR" />
            <param name="LevelMax" value="FATAL" />
        </filter>
    </appender>

    <root>
        <priority value="WARN" />
        <appender-ref ref="email" />
        <appender-ref ref="console" />
        <appender-ref ref="dailyrollinglogfile" />
    </root>
</log4j:configuration>

This is just a log4j issue. It appears that <priority> is not a valid sub-element of the logger element <root> . Rather, you should have <level> instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM