»Ë»Ñ Æ÷·³
°³¹ßÀÚÆ÷·³ ÀÔ´Ï´Ù.
  • ºÏ¸¶Å© ¾ÆÀÌÄÜ

[Áú¹®] Java Log4j³ª Sl4j µî ·Î±×¼³Á¤ À߾ƽôºв² Áú¹®Á»µå¸±°Ô¿ä3

  • °«½ºÅÊ
  • µî·ÏÀÏ 2015-02-07 13:58
  • Á¶È¸¼ö 1908
¹ú½á 4½Ã°£Â°±º¿ä ¿Ö·¸°Ô LOGȯ°æÀâ±â°¡ ¾î·Á¿îÁö 

À¥ ÇÁ·ÎÁ§Æ®´Â ¾Æ´Ï±¸¿ä  ±×³É ÀÏ¹Ý  ÇÁ·Î¼¼½º µ¥¸óÀÔ´Ï´Ù.

MYSQLÀ̸ç ibatis 2.3.4¹öÁ¯ÀÌ°í Mapper·Î queryForObject·Î »ç¿ëµÇ´Â ¹æ½ÄÀ̱¸¿ä

µµ¹«Áö ¼¼ÆÃÀ» ÇغÁµµ Á׾ ¾ÈµÇ³×¿ä Äõ¸® ·Î±×´Â ¤Ð¤Ð  

Äõ¸®¸¦ Á¦¿ÜÇÑ ¸ðµç·Î±×´Â Àß³ª¿À°í  ±âµ¿ÇÒ¶§ ¿À·ùµµ ¾ø½À´Ï´Ù.

ÇÏ·çÁ¾ÀÏÇÏ´Ù°¡ ³Ê¹« ±Þ ¿ì¿ïÇØÁ®¼­ ¤Ð 
Ȥ½Ã³ª ¾Æ´ÂºÐÀÌ °è½Ç°Í°°¾Æ ¹®Àǵå·Áº¾´Ï´Ù.



[»ç¿ë ¹æ¹ý]
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;

private static Logger logger = LoggerFactory.getLogger(DaemonMain.class);
logger.debug("TEST");  

À§¿Í°°Àº°ÍÀº Á¤¸»ÀߵǴµ¥ IBATIS Äõ¸®·Î±×¸¸¾ÈµÇ³×¿ä


[ÇÁ·Î¼¼½º ±âµ¿½Ã ¶ß´Â ·Î±×]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]

[»ç¿ëÁßÀÎ lib]
logback-access-1.0.13.jar
logback-classic-1.0.13.jar
logback-core-1.0.13.jar
mysql-connector-java-5.1.17-bin.jar
commons-pool-1.3.jar
commons-logging-1.1.jar
commons-io-2.4.jar
commons-dbcp-1.2.2.jar
ibatis-2.3.4.726.jar
log4j-1.2.16.jar
log4sql.jar
slf4j-api-1.6.4.jar
slf4j-log4j12-1.6.4.jar
sqljdbc4.jar
ojdbc6.jar




<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logback [
<!ENTITY LOG_HOME "/home/admin">
<!ENTITY LOG_LEVEL "DEBUG">
]>
<configuration> 
<appender name="service" class="ch.qos.logback.core.rolling.RollingFileAppender">  
<File>&LOG_HOME;/mylog.log</File>  
<encoder>   
<pattern>[%d{HH:mm:ss.SSS}] %-5p [%t][%C{1}.%M:%L]-%m%n</pattern>  
</encoder>  
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">   
<fileNamePattern>&LOG_HOME;/mylog.%d{yyyy-MM-dd}</fileNamePattern>  
</rollingPolicy> 
</appender>
<logger name="com.mypackage" level="&LOG_LEVEL;" />
<logger name="com.ibatis" level="&LOG_LEVEL;" />    
<logger name="java.sql.ResultSet" level="&LOG_LEVEL;" />    
<logger name="java.sql.PreparedStatement" level="&LOG_LEVEL;" />    
<logger name="java.sql.Statement" level="&LOG_LEVEL;" />    
<logger name="java.sql.Connection" level="&LOG_LEVEL;" />    
<root level="&LOG_LEVEL;">        
<appender-ref ref="service"/>    
</root> 
</configuration>

0
ÃßõÇϱ⠴ٸ¥ÀÇ°ß 0
|
°øÀ¯¹öÆ°

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ARMADA700

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ¾Æ½ê»ËÀ¯½ê»Ñ»Ë!

´Ù¸¥ÀÇ°ß 0 Ãßõ 0 ½ººÀ»ð»ç¶ó
  • ¾Ë¸² ¿å¼³, »óó ÁÙ ¼ö ÀÖ´Â ¾ÇÇÃÀº »ï°¡ÁÖ¼¼¿ä.
©¹æ »çÁø  
¡â ÀÌÀü±Û¡ä ´ÙÀ½±Û ¸ñ·Ïº¸±â