source: other-projects/maori-lang-detection/conf/log4j.properties.in@ 36317

Last change on this file since 36317 was 33938, checked in by ak19, 4 years ago
  1. Don't regenerate random sample of web page urls and full web page url listing files if they already exist, as we don't want to accidentally lose any manual work done to the random sample file when rerunning the code. 2. Fixed up duplicate logging of command run by SafeProcess by recompiling. 2. System output commands replaced by logger calls where appropriate, since logger is also outputting to console. 4. Clarifying some log4j.props comments
File size: 2.7 KB
Line 
1# See for basic example https://stackoverflow.com/questions/125 32339/no-appenders-could-be-found-for-loggerlog4j
2# For better examples, see /greenstone/greenstone3/web/WEB-INF/classes/log4j.properties
3# Manual (examples use XML versions of log4j config files): https://logging.apache.org/log4j/2.x/manual/configuration.html
4# https://logging.apache.org/log4j/2.x/manual/configuration.html#Properties
5# HH (0-24 hrs) vs hh (0-12 hrs, am/pm): https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
6# https://logging.apache.org/log4j/1.2/manual.html
7#######################
8
9# define some reusable properties
10[email protected]@
11maori-lang-detector.logpath=${maori-lang-detector.home}/logs
12
13# Let's log everything from the most basic DEBUG msgs on (so INFO, WARN, ERROR too)
14# Also want to log to the console, see
15# https://stackoverflow.com/questions/3382985/how-to-make-log4j-to-write-to-the-console-as-well
16
17log4j.rootCategory=DEBUG, console, mldlog
18
19# Define Console Appender
20log4j.appender.console=org.apache.log4j.ConsoleAppender
21# Define the layout for console appender. If you do not define it, you will get an error
22log4j.appender.console.layout=org.apache.log4j.PatternLayout
23log4j.appender.console.Target=System.err
24
25# We're saying our log "mldlog" is some file that gets appended to,
26# and that log messages from DEBUG level onwards should be writen out to
27# - "maori-lang-detector.log" located in whatever we defined the "logpath" to be
28# - the console with StdErr
29
30# Old way of logging:
31#log4j.appender.mldlog=org.apache.log4j.RollingFileAppender
32#log4j.appender.mldlog.File=${maori-lang-detector.logpath}/maori-lang-detector.log
33## https://howtodoinjava.com/log4j/log4j-rolling-file-appender/
34##log4j.appender.mldlog.MaxBackupIndex=10
35
36# We want a DailyRollingFileAppender.
37# Its behaviour is explained at
38# https://examples.javacodegeeks.com/enterprise-java/log4j/log4j-rolling-daily-file-example/
39log4j.appender.mldlog=org.apache.log4j.DailyRollingFileAppender
40log4j.appender.mldlog.File=${maori-lang-detector.logpath}/maori-lang-detector.log
41log4j.appender.mldlog.DatePattern='.'yyyy-MM-dd
42 # set to roll over every day, can change this to weekly/every min etc, see https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/DailyRollingFileAppender.html
43
44# if you have more logs, define category, additivity, appender and appender.File for it as above
45# for each log also set the format of the output as below, after setting the layout to use PatternLayout class to parse the format
46
47log4j.appender.mldlog.layout=org.apache.log4j.PatternLayout
48log4j.appender.mldlog.layout.ConversionPattern=%-5p: [%d{yyyy-MM-dd HH:mm:ss}] %C{1}.%M()%n %m%n
49
50#######################
Note: See TracBrowser for help on using the repository browser.