root/other-projects/the-macronizer/trunk/web/log4j.properties.in @ 32623

Revision 32623, 1.8 KB (checked in by ak19, 20 months ago)

Overlooked Rebekah's notes saying that the Macronizer log4j.props file should go into the Macronizer installation's web/WEB-INF/classes folder and not into the GS3 installation's web/WEB-INF/classes folder. Wasted time trying different solutions to get debugging output to go into the macron log.

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
10macronizer.home=@macronizer.home@
11macronizer.logplace=${macronizer.home}/web/logs
12
13# Let's log everything from the most basic DEBUG msgs on (so INFO, WARN, ERROR too)
14log4j.rootCategory=DEBUG, macronlog
15
16# copied from GS3
17log4j.category.web.servlets.DirectInput=INFO, macronlog
18# Prevent macronizer 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 "macronlog" is some file that gets appended to,
23# and it will write it out to "macron.log" located in whatever we defined the "logplace" to be
24log4j.appender.macronlog=org.apache.log4j.RollingFileAppender
25log4j.appender.macronlog.File=${macronizer.logplace}/macron.log
26
27# if you have more logs, define category, additivity, appender and appender.File for it as above
28# for each log also set the format of the output as below, after setting the layout to use PatternLayout class to parse the format
29
30log4j.appender.macronlog.layout=org.apache.log4j.PatternLayout
31log4j.appender.macronlog.layout.ConversionPattern=%-5p: [%d{yyyy-MM-dd HH:mm:ss}] %C{1}.%M()%n %m%n
32
33#######################
Note: See TracBrowser for help on using the browser.