내 프로젝트에 Spring iBatis Framework를 사용하고 있습니다. 그런 다음 logback을 사용하여 im 로깅합니다. 그런 다음 로그 파일을 확인 때, 나는 .. 내가 여기 logs - 로그 파일에서 데이터베이스 정보를 제거하는 방법
샘플 로그입니다 보안을 위해이 숨기려는 ...
12:22:59.585 [http-bio-3088-exec-1] DEBUG org.mybatis.spring.SqlSessionUtils - Creating SqlSession with JDBC Connection [jdbc:postgresql://127.0.0.1:5432/SAMPLEDB, UserName=postgres, PostgreSQL Native Driver]
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.Connection - ooo Connection Opened
12:22:59.585 [http-bio-3088-exec-1] DEBUG o.m.s.t.SpringManagedTransaction - JDBC Connection [jdbc:postgresql://127.0.0.1:5432/SAMPLEDB, UserName=postgres, PostgreSQL Native Driver] will not be managed by Spring
12:22:59.585 [http-bio-3088-exec-1] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [[email protected]] was not registered for synchronization because synchronization is not active
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.PreparedStatement - ==> Executing: SELECT * (purposely deleted)
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.PreparedStatement - ==> Parameters: ADMIN(String), 0(Integer)
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.ResultSet - <== Columns: (purposely deleted, list of columns)
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.ResultSet - <== Row: 86, ADMIN, 1, 7, 0, ADMIN, 20170403, 135432, SCREENID, null, null, null, null, 0, null, 1
12:22:59.585 [http-bio-3088-exec-1] DEBUG org.mybatis.spring.SqlSessionUtils - Closing no transactional SqlSession [[email protected]]
12:22:59.585 [http-bio-3088-exec-1] DEBUG org.mybatis.spring.SqlSessionUtils - Creating SqlSession with JDBC Connection [jdbc:postgresql://127.0.0.1:5432/SAMPLEDB, UserName=postgres, PostgreSQL Native Driver]
12:22:59.585 [http-bio-3088-exec-1] DEBUG java.sql.Connection - ooo Connection Opened
12:22:59.585 [http-bio-3088-exec-1] DEBUG o.m.s.t.SpringManagedTransaction - JDBC Connection [jdbc:postgresql://127.0.0.1:5432/SAMPLEDB, UserName=postgres, PostgreSQL Native Driver] will not be managed by Spring
12:22:59.585 [http-bio-3088-exec-1] DEBUG org.mybatis.spring.SqlSessionUtils - SqlSession [[email protected]] was not registered for synchronization because synchronization is not active
12:22:59.601 [http-bio-3088-exec-1] DEBUG java.sql.PreparedStatement - ==> Executing: SELECT count(*) (purposely deleted)
12:22:59.601 [http-bio-3088-exec-1] DEBUG java.sql.PreparedStatement - ==> Parameters: 1(Integer), 7(BigDecimal), SA(String), 0(Integer), 20170404(Integer), 20170404(Integer)
12:23:00.241 [http-bio-3088-exec-1] DEBUG java.sql.ResultSet - <== Columns: count
12:23:00.241 [http-bio-3088-exec-1] DEBUG java.sql.ResultSet - <== Row: 7
logback을 시스템이 사용하는 데이터베이스를 볼 수 있습니다 .XML
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>
<appender name="WINFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>C:/logs/logfile.log</File>
<layout class="ch.qos.logback.classic.PatternLayout">
<pattern>%d{HH:mm:ss.SSS} %-5level %logger - %msg%n</pattern>
</layout>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>C:/logs/logfile-%d{yyyy-MM-dd}-%i.txt</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>2MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
<appender-ref ref="WINFILE" />
</root>
</configuration>
나는 omstSpringManagedTransaction 부분을 제거 할
덕분에 ... 이것을 로거에 영향을 미칠 것입니다. 내 코드에서 선언 할 디버그 ?? – john1717