友情链接1:21点 足球投注 投注网 明升体育 hg0088 葡京赌场 网上赌球 诈金花 澳门金沙网址 澳门银河网址 澳门银河 澳门银河官网 银河官网 威尼斯人 澳门威尼斯人 澳门威尼斯人官网 威尼斯人官网 金沙 澳门金沙 澳门金沙官网 金沙官网 现金网 赌球网 全讯网 明升国际 足球开户 ******官网 ******网址 现金赌博 澳门现金网 ******官方网站

log4j.properties 閰嶇疆鏂囦欢瀹屾暣鐗 | Mingo's Blog

log4j.properties 閰嶇疆鏂囦欢瀹屾暣鐗

鏃堕棿锛2012骞03鏈09鏃浣滆咃細Mingo琚洿瑙備簡锛5,408 娆璇勮娆℃暟锛0

Log4j 鏄竴涓敤鏉ヨ褰曟棩蹇楃殑鏃ュ織鎿嶄綔鍖咃紝鍦ㄩ」鐩腑鎴戜範鎯ч兘浼氫娇鐢ㄣ

涓嬮潰鏄竴涓猯og4j.properties 閰嶇疆鏂囦欢 瀹屾暣鐗堣瑙o細

 

log4j.rootLogger=DEBUG,CONSOLE,DATABASE,FILE
#additivity鐨勪綔鐢ㄥ湪浜 children-logger鏄惁浣跨敤 rootLogger鐨勯厤缃紝渚嬪 杈撳嚭缁堢銆
log4j.additivity.org.apache=true
# 搴旂敤浜庢帶鍒跺彴
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.Encoding=GBK
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
# 鐢ㄤ簬鏁版嵁搴
log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.DATABASE.URL=jdbc:oracle:thin:@192.168.0.103:1521:ORCL
log4j.appender.DATABASE.driver=oracle.jdbc.driver.OracleDriver
log4j.appender.DATABASE.user=Nation
log4j.appender.DATABASE.password=1
log4j.appender.CONSOLE.Threshold=WARN
log4j.appender.DATABASE.sql=INSERT INTO LOG4J(stamp,thread, infolevel,class,messages) VALUES ('%d{yyyy-MM-dd HH:mm:ss}', '%t', '%p', '%l', '%m')
# INSERT INTO LOG4J (Message) VALUES ('[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n')
# 鍐欏叆鏁版嵁搴撲腑鐨勮〃LOG4J鐨凪essage瀛楁涓紝鍐呭锛卍锛堟棩鏈燂級%c: 鏃ュ織淇℃伅鎵鍦ㄥ湴锛堢被鍚嶏級%p: 鏃ュ織淇℃伅绾у埆%m: 浜х敓鐨勬棩蹇楀叿浣撲俊鎭 %n: 杈撳嚭鏃ュ織淇℃伅鎹㈣
log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout
log4j.appender.DATABASE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
# 姣忓ぉ鏂板缓鏃ュ織
log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=C:/log4j/log
log4j.appender.A1.Encoding=GBK
log4j.appender.A1.Threshold=DEBUG
log4j.appender.A1.DatePattern='.'yyyy-MM-dd
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L : %m%n
#搴旂敤浜庢枃浠
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=C:/log4j/file.log
log4j.appender.FILE.Append=false
log4j.appender.FILE.Encoding=GBK
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
# 搴旂敤浜庢枃浠跺洖婊
log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING_FILE.Threshold=ERROR
log4j.appender.ROLLING_FILE.File=rolling.log
log4j.appender.ROLLING_FILE.Append=true
log4j.appender.CONSOLE_FILE.Encoding=GBK
log4j.appender.ROLLING_FILE.MaxFileSize=10KB
log4j.appender.ROLLING_FILE.MaxBackupIndex=1
log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#鑷畾涔堿ppender
log4j.appender.im = net.cybercorlin.util.logger.appender.IMAppender
log4j.appender.im.host = mail.cybercorlin.net
log4j.appender.im.username = username
log4j.appender.im.password = password
log4j.appender.im.recipient = yyflyons@163.com
log4j.appender.im.layout=org.apache.log4j.PatternLayout
log4j.appender.im.layout.ConversionPattern =[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#搴旂敤浜巗ocket
log4j.appender.SOCKET=org.apache.log4j.RollingFileAppender
log4j.appender.SOCKET.RemoteHost=localhost
log4j.appender.SOCKET.Port=5001
log4j.appender.SOCKET.LocationInfo=true
# Set up for Log Facter 5
log4j.appender.SOCKET.layout=org.apache.log4j.PatternLayout
log4j.appender.SOCET.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]%n%c[CATEGORY]%n%m[MESSAGE]%n%n
# Log Factor 5 Appender
log4j.appender.LF5_APPENDER=org.apache.log4j.lf5.LF5Appender
log4j.appender.LF5_APPENDER.MaxNumberOfRecords=2000
# 鍙戦佹棩蹇楃粰閭欢
log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.MAIL.Threshold=FATAL
log4j.appender.MAIL.BufferSize=10
log4j.appender.MAIL.From=abc@163.com
log4j.appender.MAIL.SMTPHost=www.zhongming.name
log4j.appender.MAIL.Subject=Log4J Message
log4j.appender.MAIL.To=abc@126.com
log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n

 

澹版槑: 鏈枃閲囩敤 BY-NC-SA 鍗忚杩涜鎺堟潈 | Mingo's Blog
杞浇璇锋敞鏄庤浆鑷log4j.properties 閰嶇疆鏂囦欢瀹屾暣鐗

鏍囩锛鍒嗙被锛Java缂栫▼
0鏉¤瘎璁

鏆傛椂娌℃湁璇勮锛

鍙戣〃璇勮

*

*