org.jacorb.util

Class ConsoleLoggerFactory

public class ConsoleLoggerFactory extends Object implements LoggerFactory

ConsoleLoggerFactory is a very simple example to demonstrate overriding the default logger factory.

Version: $Id: ConsoleLoggerFactory.java,v 1.1 2006/06/21 14:47:59 alphonse.bendt Exp $

Author: Nick Cross

Constructor Summary
ConsoleLoggerFactory()
ConsoleLoggerFactory creates a new Avalon console logger.
Method Summary
voidconfigure(Configuration arg0)
StringgetLoggingBackendName()
getLoggingBackendName returns the name of the backend.
LoggergetNamedLogger(String name)
getNamedLogger returns the logger for name.
LoggergetNamedLogger(String name, String fileName, long maxFileSize)
getNamedLogger returns the logger for name.
LoggergetNamedRootLogger(String name)
getNamedRootLogger returns the logger for name.
voidsetDefaultLogFile(String fileName, long maxLogSize)
Set the file name and max file size for logging to a file

Constructor Detail

ConsoleLoggerFactory

public ConsoleLoggerFactory()
ConsoleLoggerFactory creates a new Avalon console logger.

Method Detail

configure

public void configure(Configuration arg0)

getLoggingBackendName

public String getLoggingBackendName()
getLoggingBackendName returns the name of the backend.

Returns: the name of the actual logging mechanism, e.g., "logkit"

getNamedLogger

public Logger getNamedLogger(String name)
getNamedLogger returns the logger for name. As this is an example it simply returns the console target.

Parameters: name a String value

Returns: a console Logger for a given name

getNamedLogger

public Logger getNamedLogger(String name, String fileName, long maxFileSize)
getNamedLogger returns the logger for name. As this is an example it simply returns the console target.

Parameters: name a String value fileName a String value maxFileSize a long value

Returns: a name Logger for a given file name and max size

Throws: java.io.IOException if an error occurs

getNamedRootLogger

public Logger getNamedRootLogger(String name)
getNamedRootLogger returns the logger for name. As this is an example it simply returns the console target.

Parameters: name a String value

Returns: a console Logger for a given name

setDefaultLogFile

public void setDefaultLogFile(String fileName, long maxLogSize)
Set the file name and max file size for logging to a file

Parameters: fileName a String value maxLogSize a long value

Throws: java.io.IOException if an error occurs