org.jacorb.util
Class ConsoleLoggerFactory

java.lang.Object
  extended by org.jacorb.util.ConsoleLoggerFactory
All Implemented Interfaces:
org.apache.avalon.framework.configuration.Configurable, org.jacorb.config.LoggerFactory

public class ConsoleLoggerFactory
extends java.lang.Object
implements org.jacorb.config.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
 void configure(org.apache.avalon.framework.configuration.Configuration arg0)
           
 java.lang.String getLoggingBackendName()
          getLoggingBackendName returns the name of the backend.
 org.apache.avalon.framework.logger.Logger getNamedLogger(java.lang.String name)
          getNamedLogger returns the logger for name.
 org.apache.avalon.framework.logger.Logger getNamedLogger(java.lang.String name, java.lang.String fileName, long maxFileSize)
          getNamedLogger returns the logger for name.
 org.apache.avalon.framework.logger.Logger getNamedRootLogger(java.lang.String name)
          getNamedRootLogger returns the logger for name.
 void setDefaultLogFile(java.lang.String fileName, long maxLogSize)
          Set the file name and max file size for logging to a file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleLoggerFactory

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

Method Detail

getLoggingBackendName

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

Specified by:
getLoggingBackendName in interface org.jacorb.config.LoggerFactory
Returns:
the name of the actual logging mechanism, e.g., "logkit"

getNamedLogger

public org.apache.avalon.framework.logger.Logger getNamedLogger(java.lang.String name)
getNamedLogger returns the logger for name. As this is an example it simply returns the console target.

Specified by:
getNamedLogger in interface org.jacorb.config.LoggerFactory
Parameters:
name - a String value
Returns:
a console Logger for a given name

getNamedRootLogger

public org.apache.avalon.framework.logger.Logger getNamedRootLogger(java.lang.String name)
getNamedRootLogger returns the logger for name. As this is an example it simply returns the console target.

Specified by:
getNamedRootLogger in interface org.jacorb.config.LoggerFactory
Parameters:
name - a String value
Returns:
a console Logger for a given name

getNamedLogger

public org.apache.avalon.framework.logger.Logger getNamedLogger(java.lang.String name,
                                                                java.lang.String fileName,
                                                                long maxFileSize)
                                                         throws java.io.IOException
getNamedLogger returns the logger for name. As this is an example it simply returns the console target.

Specified by:
getNamedLogger in interface org.jacorb.config.LoggerFactory
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

setDefaultLogFile

public void setDefaultLogFile(java.lang.String fileName,
                              long maxLogSize)
                       throws java.io.IOException
Set the file name and max file size for logging to a file

Specified by:
setDefaultLogFile in interface org.jacorb.config.LoggerFactory
Parameters:
fileName - a String value
maxLogSize - a long value
Throws:
java.io.IOException - if an error occurs

configure

public void configure(org.apache.avalon.framework.configuration.Configuration arg0)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException