标签:style blog http color io ar for sp div
Configuring log4j typically involes assigning level objects, defining appender objects, and specifying Layout objects.
By default, the LogManager class will look for a file named log4j.properties or log4j.xml in the classpath used for loading the log4j classes.
If you decide to name your configuation file differently, you are free to do that. However you have to let the log4j framework know by supplying a command line argument as follows:
-Dlog4j.cofinguation="file_name".
# define the root logger with two appenders writing to console and file log4j.rootLogger = DEBUG, CONSOLE, FILE #define your own logger named com.foo #and assign level and appender to your own logger log4j.logger.com.foo=DEBUG,FILE #define the appender named FILE log4j.appender.FILE=org.apache.log4j.FileAppender log4j.appender.FILE.File=${user.home}/log.out #define the appender named CONSOLE log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender log4j.appender.CONSOLE.conversionPattern=%m%n
notable points about Configuration
标签:style blog http color io ar for sp div
原文地址:http://www.cnblogs.com/woodynd/p/4020616.html