ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • log4j.rootLogger
    2014/:: 에러 :: 2014. 9. 22. 14:56

    log4j.rootLogger=DEBUG : 실행과정도 출력

    log4j.rootLogger=ERROR : 실행결과만 출력

     

    log4j.properties

    # root logger definition
    # << sample >> log4j.rootLogger=level,appenderName 
    log4j.rootLogger=DEBUG, console
    #log4j.rootLogger=ERROR, console

    #root logger appender definition
    # << sample >> log4j.appender.appenderName=appenderClassName(FQCN)
    log4j.appender.console=org.apache.log4j.ConsoleAppender

    #root logger layout definition
    # << sample >> log4j.appender.appenderName.layout=layoutClassName(FQCN)
    log4j.appender.console.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%-5p [%t] - %m%n

     

     실행결과

     Logging initialized using 'class org.apache.ibatis.logging.log4j.Log4jImpl' adapter.
    PooledDataSource forcefully closed/removed all connections.
    PooledDataSource forcefully closed/removed all connections.
    PooledDataSource forcefully closed/removed all connections.
    PooledDataSource forcefully closed/removed all connections.
    :: 0. all User(SELECT) ?
    Openning JDBC Connection
    Created connection 2413193.
    Setting autocommit to true on JDBC Connection [oracle.jdbc.driver.T4CConnection@24d289]
    ooo Using Connection [oracle.jdbc.driver.T4CConnection@24d289]
    ==>  Preparing: SELECT user_id AS userId, user_name AS userName, password AS password, age AS age, grade AS grade, reg_date AS regDate FROM users
    ==> Parameters:
    <1>번째 회원..User [userid=user01, userName=홍길동, password=user01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]
    <2>번째 회원..User [userid=user02, userName=이순신, password=user02, age=20, grade=2, active=false, regDate=2022-02-20 14:20:22.0]
    <3>번째 회원..User [userid=user03, userName=김유신, password=user03, age=30, grade=3, active=false, regDate=2033-03-30 03:30:33.0]
    <4>번째 회원..User [userid=ibatis01, userName=홍길동iba, password=ibatis01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]
    <5>번째 회원..User [userid=ibatis02, userName=이순신iba, password=ibatis02, age=20, grade=2, active=false, regDate=2022-02-20 14:20:22.0]
    <6>번째 회원..User [userid=ibatis03, userName=김유신iba, password=ibatis03, age=30, grade=3, active=false, regDate=2033-03-30 03:30:33.0]


    ooo Using Connection [oracle.jdbc.driver.T4CConnection@24d289]
    ==>  Preparing: SELECT user_id AS userId, user_name AS userName, password AS password, age AS age, grade AS grade, reg_date AS regDate FROM users WHERE user_id = ?
    ==> Parameters: user01(String)
    :: 1. get(SELECT) ?User [userid=user01, userName=홍길동, password=user01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]


    ooo Using Connection [oracle.jdbc.driver.T4CConnection@24d289]
    ==>  Preparing: SELECT user_name FROM users WHERE user_id = ?AND password = ?
    ==> Parameters: user03(String), user03(String)
    :: 2. get(SELECT) ?김유신


    ::3. 특정 조건 User(SELECT) ?
    ooo Using Connection [oracle.jdbc.driver.T4CConnection@24d289]
    ==>  Preparing: SELECT user_name FROM users WHERE age = ?
    ==> Parameters: 20(Integer)
    <1> 번째 회원..이순신
    <2> 번째 회원..이순신iba


    ::END::SqlSession 닫기...
    Closing JDBC Connection [oracle.jdbc.driver.T4CConnection@24d289]
    Returned connection 2413193 to pool.

     

     

     

     

    log4j.properties

    # root logger definition
    # << sample >> log4j.rootLogger=level,appenderName 
    #log4j.rootLogger=DEBUG, console
    log4j.rootLogger=ERROR, console

    #root logger appender definition
    # << sample >> log4j.appender.appenderName=appenderClassName(FQCN)
    log4j.appender.console=org.apache.log4j.ConsoleAppender

    #root logger layout definition
    # << sample >> log4j.appender.appenderName.layout=layoutClassName(FQCN)
    log4j.appender.console.layout=org.apache.log4j.PatternLayout
    log4j.appender.file.layout.ConversionPattern=%-5p [%t] - %m%n

     

     실행결과

     
    :: 0. all User(SELECT) ?
    <1>번째 회원..User [userid=user01, userName=홍길동, password=user01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]
    <2>번째 회원..User [userid=user02, userName=이순신, password=user02, age=20, grade=2, active=false, regDate=2022-02-20 14:20:22.0]
    <3>번째 회원..User [userid=user03, userName=김유신, password=user03, age=30, grade=3, active=false, regDate=2033-03-30 03:30:33.0]
    <4>번째 회원..User [userid=ibatis01, userName=홍길동iba, password=ibatis01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]
    <5>번째 회원..User [userid=ibatis02, userName=이순신iba, password=ibatis02, age=20, grade=2, active=false, regDate=2022-02-20 14:20:22.0]
    <6>번째 회원..User [userid=ibatis03, userName=김유신iba, password=ibatis03, age=30, grade=3, active=false, regDate=2033-03-30 03:30:33.0]


    :: 1. get(SELECT) ?User [userid=user01, userName=홍길동, password=user01, age=10, grade=1, active=false, regDate=2011-01-10 01:10:11.0]


    :: 2. get(SELECT) ?김유신


    ::3. 특정 조건 User(SELECT) ?
    <1> 번째 회원..이순신
    <2> 번째 회원..이순신iba


    ::END::SqlSession 닫기...

공부를 해야만 하는 개발자의 방.