ITLogLib2/Java
Help version: Wed 07 Jul 2004

de.itechsoftware.itloglib2
Class ITOutputLogChannel

Object
  |
  +--de.itechsoftware.itloglib2.ITOutputLogChannel

public class ITOutputLogChannel
extends Object

Logchannels are output streams for logmessages. The logging output of a program can go to one or more logchannels.
Logchannels are defined through the configuration file, which is given as a parameter to ITLogLib.initialize.

Note: The standard logchannel, named "StdLog", is opened automatically as part of the initialization of the logging library. It is used by default whereever the logchannel name or object is omitted in a logging method.

See Also:
ITLogLib.initialize, ITLogLib.openLogChannel, ITLogLib.closeLogChannel

Method Summary
 boolean addForward(String sForwardLogChannel)
          Forwards all logmessages to an additional logchannel.
 ITLogMsg createLogMsg(String sModule, String sCase)
          Creates a logmessage with default loglevel (LEVEL_INFO for the logchannel.
 ITLogMsg createLogMsg(String sModule, String sCase, short shtLogLevel)
          Creates a logmessage for the logchannel.
 String getCurrentLogFile()
          Returns the name of the current output file of the logchannel.
 String getName()
          Returns the name of the logchannel.
 boolean isOpen()
          Determines whether the logchannel is open.
 boolean quickLog(String sModule, String sCase, String sText)
          Creates a logmessage with default loglevel LEVEL_INFO and sends it (in a single statement).
 boolean quickLog(String sModule, String sCase, String sText, short shtLogLevel)
          Creates a logmessage and sends it (in a single statement).
 boolean removeForward(String sForwardLogChannel)
          Stops forwarding all logmessages to the given logchannel.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Returns the name of the logchannel.

Returns:
name of the logchannel, as passed to ITLogLib.openLogChannel

See Also:
ITLogLib.openLogChannel, ITLogLib.closeLogChannel

isOpen

public boolean isOpen()
Determines whether the logchannel is open.

Returns:
true if the ITLogLib is initialized properly and the logchannel is open
false otherwise

See Also:
ITLogLib.openLogChannel, ITLogLib.closeLogChannel

getCurrentLogFile

public String getCurrentLogFile()
Returns the name of the current output file of the logchannel.

Note that a logfile will be created when the logchannel writes out the first (buffered) logmessage.

Returns:
name of the logfile
empty string, when no logmessage was written before

quickLog

public boolean quickLog(String sModule,
                        String sCase,
                        String sText)
Creates a logmessage with default loglevel LEVEL_INFO and sends it (in a single statement).

Note: If the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file) the logmessage will not be generated.

Parameters:
sModule - user-defined specifier, describing a module or subsystem of the logging application.
sCase - user-defined specifier, describing a use-case or operation of the logging application.
sText - logmessage text.

quickLog

public boolean quickLog(String sModule,
                        String sCase,
                        String sText,
                        short shtLogLevel)
Creates a logmessage and sends it (in a single statement).

Note: If the logchannel was not open successfully or the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file) the logmessage will not be generated.

Parameters:
sModule - user-defined specifier, describing a module or subsystem of the logging application.
sCase - user-defined specifier, describing a use-case or operation of the logging application.
sText - logmessage text.
shtLogLevel - one or more ITLoglevel constants (LEVEL_INFO, LEVEL_WARNING, LEVEL_ERROR, LEVEL_ALARM), combined by '|' (bitwise OR).

createLogMsg

public ITLogMsg createLogMsg(String sModule,
                             String sCase)
Creates a logmessage with default loglevel (LEVEL_INFO for the logchannel.

Note: If the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file), the null logmessage (a special, performance optimized always-emtpy ITLogMsg instance) will be returned.

Parameters:
sModule - user-defined specifier, describing a module or subsystem of the logging application.
sCase - user-defined specifier, describing a use-case or operation of the logging application.

Returns:
the new ITLogMsg instance

createLogMsg

public ITLogMsg createLogMsg(String sModule,
                             String sCase,
                             short shtLogLevel)
Creates a logmessage for the logchannel.

Note: If the Module/Case combination does not pass the write-out filter condition (currently defined for the logchannel in the configuration file), the null logmessage (a special, performance optimized always-emtpyITLogMsg instance) will be returned.

Parameters:
sModule - user-defined specifier, describing a module or subsystem of the logging application.
sCase - user-defined specifier, describing a use case or operation of the logging application.
shtLogLevel - one or more ITLoglevel constants (LEVEL_INFO, LEVEL_WARNING, LEVEL_ERROR, LEVEL_ALARM), combined by '|' (bitwise OR).

Returns:
the new ITLogMsg instance

addForward

public boolean addForward(String sForwardLogChannel)
Forwards all logmessages to an additional logchannel.

This method is not implemented yet. Use the online forwarding mechanism through the ITConfigManager application.

Parameters:
sForwardLogChannel - name of the logchannel to which all logmessages should be forwarded.

Returns:

See Also:
ITOutputLogChannel.removeForward

removeForward

public boolean removeForward(String sForwardLogChannel)
Stops forwarding all logmessages to the given logchannel.

This method is not implemented yet. Use the online forwarding mechanism through the ITConfigManager application.

Parameters:
sForwardLogChannel - name of the logchannel to which logmessages should not be forwarded anymore.

Returns:

See Also:
ITOutputLogChannel.addForward

ITLogLib2/Java
Help version: Wed 07 Jul 2004

Copyright 1999-2004 iTech Software GmbH, Berlin (Germany). See http://www.itech-software.com.