/ * * Author: Meanson Wang * Date: 2005-01-15 * email: meansonw@hotmail.com*/OSWORKFLOW - How to set the logging of OsWorkflow and set the level to [Debug] Workflow osworkflow uses the commons-logging component To conduct log management. But the default log level is [Debug], although Hani's manual mention [note, it is mentioned] The method of setting the log is not very good. Look at his mail list, it is also ignorant, but also, don't like writing manual is a common problem for each programmer, let alone handle how to configure his software, "There is no technical component." Ha ha. In fact, it is very simple, I know that Commons-logging is a hundred. Commons-logging is the strongest place to use multiple log components to log logs, automatically search for your [classpath] log assembly, order is log4J -> JDK1.4 logging API -> JAKARTA COMMONS - Logging Simplelog, change In order to say your system can be used for logging in any of the above log components. A lot of? If your product A uses log4j, and the product B uses the Logging API, the boss lets you embed a in B, you don't have to have a headache. You can use /Web-inf/Classes/commons-logging.properties to specify the LOG component of the system: log4j: org.apache.commons.logging.log = org.apache.commons.logging.Impl.log4jcategoryLog
JDK 1.4 loggerorg.apache.commons.logging.log = org.apache.commons.logging.Impl.jdk14logger
JCL Simplelogorg.apache.commons.logging.log = Org.apache.commons.logging.impla.simplelog huh, here are here we entered the topic. In fact, it is very simple to debug ockflow. Two steps, our goal is to manage logs with log4j: 1. Place log4j-1.2.8.jar in / web-inf / lib. 2. Establish Commons-logging.properties files in / web-inf / classes /. [Commons-logging.properties file contents: Specify the use log4j] org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JCategoryLog [log4j.properties file contents: configure log4j] log4j.rootCategory = DEBUG, stdout, Rlog4j.appender.stdout = org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout = org.apache.log4j.PatternLayoutlog4j.appender.stdout.layout.ConversionPattern =% 5p [% d]% c {2} / "% m /"% n
#### Second appender Writes to a filelog4j.appender.r = org.apache.log4j.rollingfileAppenderlog4j.Appender.r.file = .. / logs / OsWorkflow.log
# Control the maximum log file sizelog4j.appender.R.MaxFileSize = 1024KB # Archive log files (one backup file here) log4j.appender.R.MaxBackupIndex = 1log4j.appender.R.layout = org.apache.log4j.PatternLayoutlog4j.appender .R.Layout.conversionPattern =% 5P [% D]% c {2} / "% m /"% N The log will have two output: console and file, files are placed in Tomcat / Logs / below, OsWorkflow. Log.