log4j.xml 파일에 빨간색부분을 추가

로그를 저장할 경로 저장

fileName="c:/logs/all.log"


<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
 <Appenders>
  <Console name="console" target="SYSTEM_OUT">
   <PatternLayout pattern="%d %5p [%c] %m%n" />
  </Console>
  <RollingFile name="file" fileName="c:/logs/all.log"
   filePattern="c:/logs/all.%i.%d{yyyy-MM-dd}.log">
   <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
   <Policies>
    <SizeBasedTriggeringPolicy size="10MB" />
   </Policies>
   <DefaultRolloverStrategy max="1000" fileIndex="min" />
  </RollingFile>


 </Appenders>
 <Loggers>
  <Logger name="java.sql" level="DEBUG" additivity="false">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Logger>
  <Logger name="egovframework" level="DEBUG" additivity="false">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Logger>
  <!-- log SQL with timing information, post execution -->
  <Logger name="jdbc.sqltiming" level="DEBUG" additivity="false">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Logger>
  <Logger name="org.springframework" level="INFO" additivity="false">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Logger>
  <Logger name="kr.or.ddit.springmvc" level="INFO" additivity="false">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Logger>
  <Root level="ERROR">
   <AppenderRef ref="console" />
   <appender-ref ref="file" />
  </Root>
 </Loggers>
</Configuration>

신고

+ Recent posts

티스토리 툴바