??????????????
???????????????LOG4J????????????????????Ч?? ?????????commons-logging-xxx.jar??log4j-xxx.jar??????JAR????XXX??汾???

????????????????
????1??????????? ????????????????????????д???????????洢????????????????????? ?????????????????????????з?????????????????????????? CREATE TABLE RESLOG (LOGID VARCHAR2(20) NOT NULL?? CLASS VARCHAR2(200)?? METHOD VARCHAR2(100)?? CREATETIME DATE?? LOGLEVEL VARCHAR2(50)?? MSG VARCHAR2(4000)) ????洢???????????·????????CLASS??γ??????????

????2????????????? LOG4J????????????????.properties??.xml????????properties???????????? ????????XML???????????????????????????????????????ɡ? ?????LOG4J.PROPERTIES???????????? log4j.rootLogger= XXX??????????????????????????????????????? ???????XXX?????“DB”????log4j.rootLogger=INFO??stdout??Platform??db?????? ??????????м????INFO??????????STDOUT??PLATFORM??DB ??DATABASE???С? ???ú???????????LOG4J???????????????????????????????????? ?????????????????????????棬???????????????????SQL??????????????£? ###JDBCAppender log4j.appender.db = org.apache.log4j.jdbc.JDBCAppender //???????????????JDBCAppender???????????????洢?????????????????????????????????????д???????JDBCAppenderOK??? log4j.appender.db.BufferSize=1 //????????????LOG4J???ж??????????????????????????????1?????????????????????????????????????????????????? log4j.appender.db.driver=oracle.jdbc.driver.OracleDriver //????????????LOG4J?????????洢??????????? log4j.appender.db.URL=jdbc:oracle:thin:@:: //?????????????????URL??????????????? log4j.appender.db.user=XXX log4j.appender.db.password=XXX //????????????????????????????????????? log4j.appender.db.sql=insert into RESLOG (LogId??Class??Method??createTime??LogLevel??MSG) values (SQ_RESLOG_LOGID.Nextval??'%C'??'%M'?? to_date('%d{yyyy-MM-dd HH:mm:ss}'??'yyyy-MM-dd HH24:mi:ss')??'%p'??'%m') //?????????????LOG4J??????洢?????????SQL???SQ_RESLOG_LOGID.Nextval??????????SEQUENCE??‘%C’??????е?CLASS??‘%M’???????????е???????????‘%d’????????????????????‘%P’?????????????INFO??DEBUG??ERROR???‘%m’??MSG??????????????????????????Сд?? log4j.appender.db.layout=org.apache.log4j.PatternLayout ??????????????????????????LOG4J???????????洢??.LOG????е?????????洢??????????