Logging setup in properties file

Please post support and help requests here.
hdetter
Posts: 6
Joined: 22 Apr 2008, 09:03
Location: Other

Logging setup in properties file

Postby hdetter » 12 Jun 2008, 13:26

Hi,

I probably do not fully understand how to use properties files to setup logging as I want it. I would like to have a properties file, so that logging of my application goes to a ConsoleChannel and a FileChannel in parallel.
An example of such a properties file would be very helpful.

Thanks a lot

Hans


guenter
Posts: 1190
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: Logging setup in properties file

Postby guenter » 12 Jun 2008, 13:45

Hi Hans,

The key is to use the SplitterChannel. Here's a sample configuration:

Code: Select all


logging.loggers.root.channel  = splitter
logging.loggers.root.level = information

logging.channels.splitter.class = SplitterChannel
logging.channels.splitter.channels = file, console

logging.channels.file.class = FileChannel
logging.channels.file.pattern = %Y-%m-%d %H:%M:%S.%i [%p] %s: %t
logging.channels.file.path = ${application.baseName}.log
logging.channels.file.rotation = daily
logging.channels.file.archive = number
logging.channels.file.purgeCount = 10

logging.channels.console.class = ConsoleChannel
logging.channels.console.pattern = [%p] %s: %t




Return to “Support”

Who is online

Users browsing this forum: No registered users and 1 guest

cron