source: gs3-extensions/maori-lang-detection/conf/log4j.properties@ 33400

Last change on this file since 33400 was 33400, checked in by ak19, 5 years ago
  1. Setting up log4j.properties based on the macronizer's basic one that I created with Rebekah. Also committing the log4j jar file that we use for GS3 into this extension's lib folder. 2. Previous commit also added GS3's gutil.jar into this extension's lib as I want to use SafeProcess.java to launch wget.
File size: 2.5 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
10maori-lang-detector.home=/Scratch/ak19/gs3-extensions/maori-lang-detection
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)
14log4j.rootCategory=DEBUG, mldlog
15
16# copied from GS3
17log4j.category.web.servlets.DirectInput=INFO, mldlog
18# Prevent logging duplicating its messages into rootLogger:
19# https://stackoverflow.com/questions/9208710/java-log4j-log-to-both-category-and-root-logger
20log4j.additivity.web.servlets.DirectInput=false
21
22# We're saying our log "mldlog" is some file that gets appended to,
23# and it will write it out to "maori-lang-detector.log" located in whatever we defined the "logpath" to be
24
25# Old way of logging:
26#log4j.appender.mldlog=org.apache.log4j.RollingFileAppender
27#log4j.appender.mldlog.File=${maori-lang-detector.logpath}/maori-lang-detector.log
28## https://howtodoinjava.com/log4j/log4j-rolling-file-appender/
29##log4j.appender.mldlog.MaxBackupIndex=10
30
31# We want a DailyRollingFileAppender.
32# Its behaviour is explained at
33# https://examples.javacodegeeks.com/enterprise-java/log4j/log4j-rolling-daily-file-example/
34log4j.appender.mldlog=org.apache.log4j.DailyRollingFileAppender
35log4j.appender.mldlog.File=${maori-lang-detector.logpath}/maori-lang-detector.log
36log4j.appender.mldlog.DatePattern='.'yyyy-MM-dd
37 # 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
38
39# if you have more logs, define category, additivity, appender and appender.File for it as above
40# for each log also set the format of the output as below, after setting the layout to use PatternLayout class to parse the format
41
42log4j.appender.mldlog.layout=org.apache.log4j.PatternLayout
43log4j.appender.mldlog.layout.ConversionPattern=%-5p: [%d{yyyy-MM-dd HH:mm:ss}] %C{1}.%M()%n %m%n
44
45#######################
Note: See TracBrowser for help on using the repository browser.