de.esprit.netsuite.server.log

## Class LogChannelManager

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<S>
    - - de.esprit.netsuite.server.AbstractServerObject<ServerContext>
      - - de.esprit.netsuite.server.log.LogChannelManager

- All Implemented Interfaces:
    ApplicationObject<ServerContext>, SimpleLogSupport, Dumpable, ServerObject<ServerContext>

      public class LogChannelManager
      extends AbstractServerObject<ServerContext>

  This class is a cache for all LogChannels opened by the server
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LogChannelManager(ServerContext serverCtx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanupLogFiles()`
    `void` | `close()` Closes all LogChannels of the server.
    `ServerLogChannel` | `getDefaultLogChannel()` Returns the default LogChannel of the server.
    `ServerLogChannel` | `getLogChannel(SessionId sessId)` Same as `getLogChannel(String)`.
    `ServerLogChannel` | `getLogChannel(java.lang.String chName)` Returns the LogChannel with the given name.
    `java.lang.String[]` | `getLogChannelNames()` Returns the names of all cached LogChannels
    `LogLevel` | `getLogLevel()`
    `int` | `getSize()` Returns the number of cached LogChannels (not including the default LogChannel)
    `void` | `logMessage(SessionId sessId, LogLevel level, java.lang.Object caller, java.lang.String message, java.lang.Exception e)`
    `void` | `logMessage(SessionId sessId, LogLevel level, java.lang.Object caller, java.lang.String message, java.lang.Exception e, boolean doAllowSend)` Logs a message to the client specific logChannel
    `boolean` | `remove(java.lang.String chName)` Removes the named cached LogChannel
    `void` | `reset()` Closes and removes all client related LogChannels
    `void` | `setFileSizeLimit(int maxLines)` Sets the file-size-limit on all open LogChannels
    `void` | `setLogLevel(LogLevel logLevel)`
    `void` | `startFileLogging()` Actually starts logging on the default LogChannel
    `void` | `startSendingLogMessages()`

    - ### Methods inherited from class de.esprit.netsuite.server.AbstractServerObject

      `getServerConfig, getServerContext, getServerParams, getServerStartup, getStatisticManager, toString`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationConfig, getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LogChannelManager

          public LogChannelManager(ServerContext serverCtx)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### getLogLevel

          public LogLevel getLogLevel()

    - #### setLogLevel

          public void setLogLevel(LogLevel logLevel)

    - #### getDefaultLogChannel

          public ServerLogChannel getDefaultLogChannel()

      Returns the default LogChannel of the server. This LogChannel exists always and is not cached in the map.

    - #### getLogChannel

          public ServerLogChannel getLogChannel(java.lang.String chName)

      Returns the LogChannel with the given name. The LogChannel will be created if it does not exist yet. If creation fails then the default LogChannel is returned reporting an according error.

    - #### getLogChannel

          public ServerLogChannel getLogChannel(SessionId sessId)

      Same as `getLogChannel(String)`. If the sessionId is null then the default logchannel is returned.

    - #### remove

          public boolean remove(java.lang.String chName)

      Removes the named cached LogChannel

    - #### getLogChannelNames

          public java.lang.String[] getLogChannelNames()

      Returns the names of all cached LogChannels

    - #### close

          public void close()

      Closes all LogChannels of the server.

    - #### getSize

          public int getSize()

      Returns the number of cached LogChannels (not including the default LogChannel)

    - #### startFileLogging

          public void startFileLogging()
                                throws java.lang.Exception

      Actually starts logging on the default LogChannel
      Throws:
        `java.lang.Exception`

    - #### setFileSizeLimit

          public void setFileSizeLimit(int maxLines)

      Sets the file-size-limit on all open LogChannels

    - #### reset

          public void reset()

      Closes and removes all client related LogChannels

    - #### cleanupLogFiles

          public void cleanupLogFiles()

    - #### logMessage

          public void logMessage(SessionId sessId,
                        LogLevel level,
                        java.lang.Object caller,
                        java.lang.String message,
                        java.lang.Exception e,
                        boolean doAllowSend)

      Logs a message to the client specific logChannel

    - #### startSendingLogMessages

          public void startSendingLogMessages()

    - #### logMessage

          public void logMessage(SessionId sessId,
                        LogLevel level,
                        java.lang.Object caller,
                        java.lang.String message,
                        java.lang.Exception e)

Copyright © 2012 EsprIT-Systems. All Rights Reserved.