geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Farb" <>
Subject [log] [config] Configure log4j to files
Date Thu, 25 Dec 2003 15:11:14 GMT

My compliments and thanks to all who have worked on Geronimo so far.
I hope to become a useful contributor. So here is my first one.

I didn't find this anywhere on the wiki, or in the archives,
so I built a and a maven modification to send the
Geronimo logs to a file directory. Suggestions for improvement are
welcome and encouraged. I will put this in the wiki if I recieve
no updates after a week or so.

1. In the maven.xml for the run:main and the debug:main goals, add
the system property logs.home (I didn't want to change geronimo.home,
and the file: prefix messes things up.):

     <sysproperty key="geronimo.home" value="file:${run.dir}/"/>
     <sysproperty key="logs.home" value="${run.dir}"/>

The property ${logs.home} is picked up in the file and
allows you to NOT hardcode the directory.

2. Manually create a "logs" directory in target/geronimo-DEV. It would be
nice if this were not necessary, but...

3. Modify the target/geronimo-DEV/etc/ (run time) and the
modules/kernel/src/conf/ (CVS'd) files as follows: (I left
the CONSOLE definition in, it doesn't hurt and provides documentation.)

(I vote for flat file configuration, at least then you can document what you
have done and why you have done it. If you feel inclined.)

## Log4j Configuration
## $Revision: 1.2 $ $Date: 2003/11/06 20:56:31 $

log4j.rootCategory=TRACE#org.apache.geronimo.kernel.log.XLevel, LOGFILE

# CONSOLE logger definition
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}]

# LOGFILE Logger Definintion
# Use a RollingFileAppender to minimize the file size.

# The following requires the manual creating of a logs
# subdirectory in target/gernonimo-DEV


# Theoretically this rewites the file every time. Set Append to true if
# you want a cumulative log.

# Don't buffer log I/O. This is the default, but document, document, ...
log4j.appender.LOGFILE.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c{1}]

# Geronimo and other flags

View raw message