我有一个Web服务程序,它有多个类相互通信。
在eclipse中使用tomcat运行程序后,我在soap UI中复制wsdl url来测试它,如果有任何异常,那么它必须打印在日志文件中,因为我是文件appender逻辑来自log4j。花了将近三天没有运气
这是log4j.properties文件:
# Define the root logger with appender file
log4j.rootLogger = DEBUG, FILE, theConsoleAppender
log4j.category.com.wataniya.Wataniya_WebServiceSkeleton=DEBUG, FILE
### direct log messages to stdout ###
log4j.appender.theConsoleAppender=org.apache.log4j.ConsoleAppender
log4j.appender.theConsoleAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.theConsoleAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
# Define the file appender
log4j.appender.FILE=org.apache.log4j.FileAppender
# Set the name of the file
log4j.appender.FILE.File=log.txt
# Set the immediate flush to true (default)
log4j.appender.FILE.ImmediateFlush=true
# Set the threshold to debug mode
log4j.appender.FILE.Threshold=debug
# Set the append to false, overwrite
log4j.appender.FILE.Append=true
# Define the layout for file appender
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.conversionPattern= %d{dd MMM yyyy HH:mm:ss,SSS} %c %p %t %m%n%n