У меня есть приложение весенней загрузки, которое использует Logback для регистрации.
Я использую RollingFileAppender
для журналов отладки и ошибок.
Моя проблема в том, что я получаю некоторые DEBUG SMTP
и другие журналы, связанные с почтойв моем catalina.out
файле.
Я бы хотел, чтобы они записывались в мой файл DEBUG.
Ниже приведена моя конфигурация входа в систему (xml).
XML-код возврата:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="LOG_PATH" value="${logs.path.location}"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} -
%msg%n
</Pattern>
</layout>
</appender>
<appender name="FILE-AUDIT"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/iyotbihagay_debug.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} - %msg%n
</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${LOG_PATH}/archived/iyotbihagay_debug.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<appender name="FILE-ERROR"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/iyotbihagay_error.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} - %msg%n
</Pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${LOG_PATH}/archived/iyotbihagay_error.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>10MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<logger name="ch.qos.logback" level="WARN" additivity="false">
<if condition='property("profile").contains("dev")'>
<then>
<appender-ref ref="STDOUT" />
</then>
</if>
<appender-ref ref="FILE-AUDIT" />
</logger>
<logger name="org.springframework" level="INFO" additivity="false">
<if condition='property("profile").contains("dev")'>
<then>
<appender-ref ref="STDOUT" />
</then>
</if>
<appender-ref ref="FILE-AUDIT" />
</logger>
<logger name="org.springframework.beans" level="WARN"
additivity="false">
<if condition='property("profile").contains("dev")'>
<then>
<appender-ref ref="STDOUT" />
</then>
</if>
<appender-ref ref="FILE-AUDIT" />
</logger>
<logger name="java.sql" level="ERROR" additivity="false">
<if condition='property("profile").contains("dev")'>
<then>
<appender-ref ref="STDOUT" />
</then>
</if>
<appender-ref ref="FILE-AUDIT" />
</logger>
<root level="ERROR">
<if condition='property("profile").contains("dev")'>
<then>
<appender-ref ref="STDOUT" />
</then>
</if>
<appender-ref ref="FILE-AUDIT" />
<appender-ref ref="FILE-ERROR" />
</root>
</configuration>
Журналы (catalina.out):
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
STARTTLS
220 2.0.0 Ready to start TLS
EHLO ecomm-dev2
250-smtp.gmail.com at your service, [101.78.249.147]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "35882577"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: protocolConnect login, host=smtp.gmail.com, user=bilatbasa@gmail.com, password=<non-null>
DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM XOAUTH2
DEBUG SMTP: Using mechanism LOGIN
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded
DEBUG SMTP: use8bit false
MAIL FROM:<tomcat@ecomm-bilatdev2>
250 2.1.0 OK w127-v6sm20332821pfd.112 - gsmtp
RCPT TO:<kataw.anan@gmail.com>
250 2.1.5 OK w127-v6sm20332821pfd.112 - gsmtp
DEBUG SMTP: Verified Addresses
DEBUG SMTP: kataw.anan@gmail.com
DATA
354 Go ahead w127-v6sm20332821pfd.112 - gsmtp
Date: Tue, 16 Oct 2018 21:24:26 +0800 (HKT)
Reply-To: no-reply@iyotbihagay.com
To: kataw.anan@gmail.com
Message-ID: <544564802.2.1539696266428@ecomm-bilatdev2>
Subject: Test mail profile staging 0004
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_0_356550530.1539696264700"
------=_Part_0_356550530.1539696264700
Content-Type: multipart/related;
boundary="----=_Part_1_875170902.1539696264700"
------=_Part_1_875170902.1539696264700
Content-Type: text/html;charset=UTF-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Есть идеи, почему DEBUG SMTP
и сообщения, связанные с почтой, отображаются в catalina.out
?
Спасибо!