| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | <classpathentry kind="lib" path="lib/apache/commons-jxpath-1.3.jar"/> | |
| 17 | 17 | <classpathentry kind="lib" path="lib/apache/commons-lang-2.6.jar"/> | |
| 18 | 18 | <classpathentry kind="lib" path="lib/apache/commons-lang3-3.1.jar"/> | |
| 19 | - <classpathentry kind="lib" path="lib/apache/commons-logging-1.1.1.jar"/> | ||
| 19 | + <classpathentry kind="lib" path="lib/apache/commons-logging-1.1.1.jar" sourcepath="libsrc/apache/commons-logging-1.1.1-sources.jar"/> | ||
| 20 | 20 | <classpathentry kind="lib" path="lib/apache/commons-logging-adapters-1.1.1.jar"/> | |
| 21 | 21 | <classpathentry kind="lib" path="lib/apache/commons-logging-api-1.1.1.jar"/> | |
| 22 | 22 | <classpathentry kind="lib" path="lib/mq/commons-cli-1.1.jar"/> | |
@@ -47,5 +47,6 @@ | |||
| 47 | 47 | <classpathentry kind="lib" path="lib/spring/spring-web-3.2.2.RELEASE.jar"/> | |
| 48 | 48 | <classpathentry kind="lib" path="lib/spring/spring-webmvc-3.2.2.RELEASE.jar"/> | |
| 49 | 49 | <classpathentry kind="lib" path="lib/spring/spring-webmvc-portlet-3.2.2.RELEASE.jar"/> | |
| 50 | + <classpathentry kind="lib" path="lib/apache/log4j/log4j-1.2.17.jar"/> | ||
| 50 | 51 | <classpathentry kind="output" path="bin"/> | |
| 51 | 52 | </classpath> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + eclipse.preferences.version=1 | ||
| 2 | + encoding//src/common-logging.properties=UTF-8 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + # commons-logging.properties 文件配置信息 | ||
| 2 | + | ||
| 3 | + #org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog | ||
| 4 | + # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). | ||
| 5 | + | ||
| 6 | + # 利用log4j为输出介质 | ||
| 7 | + org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog | ||
| 8 | + | ||
| 9 | + # JDK5 Logger | ||
| 10 | + #org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + log4j.rootLogger=info, stdout | ||
| 2 | + log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
| 3 | + log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
| 4 | + # Pattern to output the caller's file name and line number. | ||
| 5 | + log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + package com.xdc.basic.example.apache.commons.logging; | ||
| 2 | + | ||
| 3 | + import org.apache.commons.logging.Log; | ||
| 4 | + import org.apache.commons.logging.LogFactory; | ||
| 5 | + | ||
| 6 | + public class LogTest | ||
| 7 | + { | ||
| 8 | + private static Log log = LogFactory.getLog(LogTest.class); | ||
| 9 | + | ||
| 10 | + public static void main(String[] args) | ||
| 11 | + { | ||
| 12 | + log.isFatalEnabled(); // true | ||
| 13 | + log.isErrorEnabled(); // true | ||
| 14 | + log.isWarnEnabled(); // true | ||
| 15 | + log.isInfoEnabled(); // true | ||
| 16 | + log.isDebugEnabled(); // false | ||
| 17 | + log.isTraceEnabled(); // false | ||
| 18 | + | ||
| 19 | + log.fatal("fatal"); | ||
| 20 | + log.error("error"); | ||
| 21 | + log.warn("warn"); | ||
| 22 | + log.info("info"); | ||
| 23 | + log.debug("debug"); | ||
| 24 | + log.trace("trace"); | ||
| 25 | + } | ||
| 26 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + # commons-logging.properties 文件配置信息 | ||
| 2 | + | ||
| 3 | + #org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog | ||
| 4 | + # Must be one of ("trace", "debug", "info", "warn", "error", or "fatal"). | ||
| 5 | + | ||
| 6 | + # 利用log4j为输出介质 | ||
| 7 | + org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog | ||
| 8 | + | ||
| 9 | + # JDK5 Logger | ||
| 10 | + #org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,5 @@ | |||
| 1 | + log4j.rootLogger=info, stdout | ||
| 2 | + log4j.appender.stdout=org.apache.log4j.ConsoleAppender | ||
| 3 | + log4j.appender.stdout.layout=org.apache.log4j.PatternLayout | ||
| 4 | + # Pattern to output the caller's file name and line number. | ||
| 5 | + log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments