Load log4j configuration from {sakai.home}/log4j.properties

Description

This patch provides an easy way to define a custom configuration for log4j globally for sakai.

All that is needed is a log4j.properties file in {sakai.home}.

Attachments

2

Activity

Show:

Matthew Buckett March 10, 2014 at 4:58 AM

Tested against trunk kernel.
Put log4j.properties in sakai folder containing:

log4j.rootLogger=warn,stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=Testing %d{ABSOLUTE} %5p %c{1}:%L - %m%n

Once the kernel was started up I saw the logging prefixed by the string "Testing " after startup was complete I edited the conversion pattern to change Testing to Cheese, waited 60 seconds (default timeout on the watchdog) and then generated some more logging and the pattern layout change had been detected.

Hudson CI Server April 19, 2013 at 9:16 AM

Integrated in kernel-trunk #661 (See http://builds.sakaiproject.org:8080/job/kernel-trunk/661/)

Result = SUCCESS

Aaron Zeckoski April 19, 2013 at 7:22 AM

Ready for QA

Aaron Zeckoski April 19, 2013 at 7:21 AM

Attaching patch as applied, also added a note to the sample config file.

Matthew Jones April 18, 2013 at 9:52 AM

I agree with this comment, should just be

PropertyConfigurator.configureAndWatch() instead of the what's in this patch.

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created November 14, 2012 at 3:55 AM
Updated June 11, 2024 at 7:18 AM
Resolved April 19, 2013 at 7:21 AM