0

将 AS7 与 Spring 和 Log4J 一起使用,为什么我无法将 spring 跟踪输出到控制台。

这是我的 log4f.xml

<?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 [%t] %-5p %c - %m%n" />
            </layout>
        </appender>


        <appender name="dailyrollinglogfile" class="org.apache.log4j.DailyRollingFileAppender">
            <param name="file" value="./inquiry.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 [%t] %-5p %c - %m%n" />
            </layout>
        </appender>

        <root>
            <priority value="trace"/>
            <appender-ref ref="console"/>
        </root>


    </log4j:configuration>
4

0 回答 0