log4j.rootCategory=debug, rolling # log4j.rootCategory=warn, stdout, rolling, socketLogger, lf5, xml, lf5Rolling # Example of adding a specific package/class at a different # logging level... # --log everything in the com.johnmunsch package at debug level # ..even better, send it to a different appender. Note, however, that # this doesn't mean that any loggers from a lower level won't be used: # everything still inherits, so this new logger is used _in_addition_to_ # the loggers it would have otherwise already used. log4j.category.com.johnmunsch=debug, socketLogger # --on the other hand, everything in the # com.johnmunsch.stuff class _shouldn't_ log # unless the log message is at 'warn' level or worse. # (It just so happens that stuff generates a _lot_ of # logging when it's used) log4j.category.com.johnmunsch.stuff=warn # --also, it just so happens that we have a different # appender that we're using that we want to have # log information from a specific location, and we # don't want to send that information anywhere else. log4j.category.com.johnmunsch.otherstuff=warn, xml log4j.additivity.com.johnmunsch.otherstuff=false # BEGIN APPENDER: CONSOLE APPENDER (stdout) # first: type of appender (fully qualified class name) log4j.appender.stdout=org.apache.log4j.ConsoleAppender # second: Any configuration information needed for that appender. # Many appenders require a layout. log4j.appender.stdout.layout=org.apache.log4j.TTCCLayout # log4j.appender.stdout.layout=org.apache.log4j.SimpleLayout # Possible information overload? # log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # additionally, some layouts can take additional information -- # like the ConversionPattern for the PatternLayout. # log4j.appender.stdout.layout.ConversionPattern=%d %-5p %-17c{2} (%30F:%L) %3x - %m%n # END APPENDER: CONSOLE APPENDER (stdout) # BEGIN APPENDER: ROLLING FILE APPENDER (rolling) # first: type of appender (fully qualified class name) log4j.appender.rolling=org.apache.log4j.RollingFileAppender # second: Any configuration information needed for that appender. # Many appenders require a layout. log4j.appender.rolling.File=example.log log4j.appender.rolling.MaxFileSize=100KB # Keep one backup file log4j.appender.rolling.MaxBackupIndex=1 log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%p %t %c - %m%n # Possible information overload? # log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # additionally, some layouts can take additional information -- # like the ConversionPattern for the PatternLayout. # log4j.appender.stdout.layout.ConversionPattern=%d %-5p %-17c{2} (%30F:%L) %3x - %m%n # END APPENDER: ROLLING FILE APPENDER (rolling) # BEGIN APPENDER: SOCKET APPENDER (socketLogger) # Note: if you don't have anything configured to accept the events # from the socketLogger appender, you'll see an exception on program # startup (to console), and occasional status messages (to console) # on if the log4j system has managed to connect to the specified # socket.. log4j.appender.socketLogger=org.apache.log4j.net.SocketAppender log4j.appender.socketLogger.RemoteHost=localhost log4j.appender.socketLogger.Port=4445 log4j.appender.socketLogger.LocationInfo=false # END APPENDER: SOCKET APPENDER (socketLogger) # BEGIN APPENDER: LogFactor5 APPENDER (lf5) # LogFactor5 is a Swing window that directly receives logging messages and # displays them. It offers filtering, searching etc. similar to Chainsaw or # Lumbermill but you don't have to use a socket appender so it should be faster # when the logging display is on the same machine as the program issuing # messages. log4j.appender.lf5=org.apache.log4j.lf5.LF5Appender log4j.appender.lf5.MaxNumberOfRecords=1000 # END APPENDER: LogFactor5 APPENDER (lf5) # BEGIN APPENDER: XML APPENDER (xml) # A standard file appender where we have put an XML layout onto the output # event records. A file put out using this technique can be loaded after # the fact into Chainsaw for viewing, filtering, searching, etc. log4j.appender.xml=org.apache.log4j.FileAppender log4j.appender.xml.file=example_xml.log log4j.appender.xml.append=false log4j.appender.xml.layout=org.apache.log4j.xml.XMLLayout # END APPENDER: XML APPENDER (xml) # BEGIN APPENDER: LogFactor5 Rolling APPENDER (lf5Rolling) # Like the XML appender above, this is a specialized format designed to be read # from a tool. In this case LogFactor5 can load up files in this format for # after the fact review. log4j.appender.lf5Rolling=org.apache.log4j.RollingFileAppender log4j.appender.lf5Rolling.File=example_lf5.log log4j.appender.lf5Rolling.layout=org.apache.log4j.PatternLayout log4j.appender.lf5Rolling.layout.ConversionPattern=[slf5s.start]%d{DATE}[slf5s.DATE]%n %p[slf5s.PRIORITY]%n%x[slf5s.NDC]%n%t[slf5s.THREAD]%n%c[slf5s.CATEGORY]%n %l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n # END APPENDER: LogFactor5 Rolling APPENDER (lf5Rolling)