develog

[Java] log4j 본문

Dev/Java

[Java] log4j

냐옴 2016. 5. 29. 22:03

WEB-INF/log4j.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">


<appender name="stdout" class="org.apache.log4j.ConsoleAppender">

<layout class="org.apache.log4j.PatternLayout">

<param name="ConversionPattern" value="%n[%d{yyyy-MM-dd HH:mm:ss}] %l%n    %m%n" />

</layout>

</appender>


<logger name="org.springframework" additivity="false">

<level value="DEBUG" />

<appender-ref ref="stdout" />

</logger>


<root>

<level value="DEBUG" />

<appender-ref ref="stdout" />

</root>


</log4j:configuration> 



web.xml


    org.springframework.web.util.Log4jConfigListener


    log4jConfigLocation
    /WEB-INF/log4j.xml


'Dev > Java' 카테고리의 다른 글

[Java] context.xml  (0) 2016.05.30
[Maven] pom.xml, java 1.8  (0) 2016.05.29
[Java] .class 버전 확인, javap  (0) 2016.03.27
[Java] Quartz job fire manually (in JSP)  (0) 2015.10.14
JSP, download 구현시  (0) 2015.03.05
Comments