log4j.xml 1.68 KB
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC
  "-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration>
	<appender name="ConsoleAppender" class="org.apache.log4j.ConsoleAppender">
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}:%p %l - %m%n" />
		</layout>
	</appender>

	<appender name="RollingFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
		<param name="Append" value="true" />
		<param name="BufferedIO" value="true" />
		<param name="BufferSize" value="8192" />
		<param name="File" value="${catalina.base}/logs/gateway.log" />
		<param name="DatePattern" value="'.'yyyy-MM-dd'.log'" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss}:%p %l - %m%n" />
		</layout>
	</appender>

    <logger name="com.ibatis" additivity="true">
        <level value="DEBUG" />
    </logger>
    <logger name="java.sql.Connection" additivity="true">
        <level value="DEBUG" />
    </logger>
    <logger name="java.sql.Statement" additivity="true">
        <level value="DEBUG" />
    </logger>
    <logger name="java.sql.PreparedStatement" additivity="true">
        <level value="DEBUG" />
        <appender-ref ref="ConsoleAppender" />
    </logger>
    <logger name="java.sql.ResultSet" additivity="true">
        <level value="DEBUG" />
        <appender-ref ref="ConsoleAppender" />
    </logger>

	<root>
		<priority value="info" />
		<appender-ref ref="ConsoleAppender" />
		<appender-ref ref="RollingFileAppender" />
	</root>
</log4j:configuration>