Commons 闃呰絎旇 涔?Logging 綃?/a>
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

]]>