Commons 閱讀筆記 之 Logging 篇
Configure commons-logging to use log4j
?1?Environment?:?Win2000Server,Tomcat-3.3a,AXIS?and?all?the?stuff?for?\
?2?Axis(commons-logging,xerces,log4j,?etc.)
?3?
?4?What?should?I?do?for?enabling?output?axis?activity?into?log?file?
?5?
?6?My?log4j.properties?file?looks?like:
?7?
?8?/************************************************************************/
?9?
10?log4j.rootCategory=INFO,?LOGFILE
11?log4j.category.org.apache.axis=INFO
12?
13?
14?#?LOGFILE?is?set?to?be?a?File?appender?using?a?PatternLayout.
15?log4j.appender.LOGFILE=org.apache.log4j.FileAppender
16?log4j.appender.LOGFILE.File=axis.log
17?log4j.appender.LOGFILE.Append=true
18?log4j.appender.LOGFILE.Threshold=INFO
19?log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
20?log4j.appender.LOGFILE.layout.ConversionPattern=%-4r?[%t]?%-5p?%c?%x?-?%m%n
21?
22?/************************************************************************/
23?
24?I'd?created?variable?
25?
26?TOMCAT_OPTS=log4j.configuration=file:/D:/jakarta-tomcat-3.3a/webapps/axis/WEB-INF/clas?\
27?ses/log4j.properties???????????/*?Here?the?place?for?file?mentioned?above?*/
28?
29?Then?I?had?simply?started?from?console?window:
30?
31?java?-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4jFactoryLog
32?
33?org.apache.axis.client.AdminClient?list
34?
35?I?had?seen?nothing?neither?on?the?console?window?neither?in?file?axis.log
36?
37?What?else?should?I?do?with?commons-logging?or?log4j?for?logging?
38?
39?Any?help?would?be?very?appreciated.
40?
41?Andrew
posted on 2006-08-03 11:41
rox 閱讀(319)
評論(0) 編輯 收藏 所屬分類:
Log