log4j1 | Apache Log4j 2 |
---|---|
설정파일: properties | 설정파일: xml |
log4j-slf4j-impl
http://logging.apache.org/log4j/2.x/manual/configuration.html
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Logger name="com.foo.Bar" level="trace">
<AppenderRef ref="Console"/>
</Logger>
<Root level="debug">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>
http://logging.apache.org/log4j/2.x/manual/appenders.html
http://logging.apache.org/log4j/2.x/manual/layouts.html
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
10:07:44.941 [http-nio-80-exec-2] DEBUG org.apache.commons.digester.Digester.sax - ignorableWhitespace
logger.debug(String foramt, Object... args)
logger.debug("currentPage : {}, searchType: {}, searchWord : {}", pageParam, searchType, searchWord);
<Loggers>
<!-- 별도의 로거를 등록하여 따로 이벤트 등급을 설정 -->
<Logger name="kr.or.ddit.member.controller" level="debug">
<AppenderRef ref="Console"/>
</Logger>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
<Loggers>
<Logger name="com.foo.Bar" level="trace" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Root level="error">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
jdbc:log4
to the normal JDBC URL that you are using.jdbc:derby://localhost:1527//db-derby-10.2.2.0-bin/databases/MyDatabase
jdbc:log4jdbc:derby://localhost:1527//db-derby-10.2.2.0-bin/databases/MyDatabase
Set your JDBC driver class to net.sf.log4jdbc.sql.jdbcapi.DriverSpy in your application (please note that this is not the same class name as in the standard log4jdbc implementation). See the log4jdbc documentation to see the list of supported drivers, or how to add support for other drivers. log4jdbc supports almost all major drivers. (DriverSpy의 q.n copy)
driverClassName=oracle.jdbc.driver.OracleDriver
url=jdbc:oracle:thin:@localhost:1521:xe
driverClassName=net.sf.log4jdbc.DriverSpy
url=jdbc:log4jdbc:oracle:thin:@localhost:1521:xe
logger | desc |
---|---|
jdbc.sqlonly | Logs only SQL. SQL executed within a prepared statement is automatically shown with it's bind arguments replaced with the data bound at that position, for greatly increased readability. |
jdbc.sqltiming | Logs the SQL, post-execution, including timing statistics on how long the SQL took to execute. |
jdbc.audit | Logs ALL JDBC calls except for ResultSets. This is a very voluminous output, and is not normally needed unless tracking down a specific JDBC problem. |
jdbc.resultset | Even more voluminous, because all calls to ResultSet objects are logged. |
jdbc.resultsettable | Log the jdbc results as a table. Level debug will fill in unread values in the result set. |
jdbc.connection | Logs connection open and close events as well as dumping all open connection numbers. This is very useful for hunting down connection leak problems. |
<trim prefix=" WHERE" prefixOverrides="AND">
http://malsup.com/jquery/form/#options-object
안녕하세요! 좋은 글 올려주셔서 감사합니다. VO 대신 Map<String, Object> 이부분은 왜이렇게 쓰셨는지 여쭤봐도 될까요?