使用logback无法发送邮件..?任何身体请帮助.....与

时间:2010-05-05 09:27:59

标签: xml logback

请仔细阅读....

<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>%d %p %c - %m%n</Pattern>
    </layout>
</appender>
<!--                          -->
<!-- Declare the SMTPAppender -->
<!--                          -->
<appender name="EMAIL" class="ch.qos.logback.classic.net.SMTPAppender">
    <SMTPHost>smtp.gmail.com</SMTPHost>
    <To>admin@devcen.com</To>
    <From>urvish@devcen.com</From>
    <Subject>ERROR: %logger{20} - %m</Subject>
    <Username>******</Username>
    <Password>******</Password>

    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>%date %-5level %logger{35} - %message%n</Pattern>
    </layout>
</appender>
<appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <!--See also http://logback.qos.ch/manual/appenders.html#RollingFileAppender-->
    <File>example.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
        <Pattern>%d %p - %m%n</Pattern>
    </layout>
    <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
        <maxIndex>4</maxIndex>
        <FileNamePattern>example.log.%i</FileNamePattern>
    </rollingPolicy>
    <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
        <MaxFileSize>500KB</MaxFileSize>
    </triggeringPolicy>
</appender>

<logger name="org.springframework" level="WARN"/>
<logger name="org.springframework.jdbc.core.JdbcTemplate" level="WARN"/>
<logger name="org.springframework.jdbc.core.StatementCreatorUtils" level="WARN"/>
<logger name="org.springframework.security.web.FilterChainProxy" level="WARN"/>
<logger name="com.logicwind" level="INFO"/>
<logger name="performance" level="INFO"/>
<!--<logger name="org.apache.struts2" level="DEBUG"/>

- &GT;                        - &GT;         

</root> 

1 个答案:

答案 0 :(得分:0)

尝试使用logback-user邮件列表。