de.esprit.netsuite.server.core

## Class LogChannelManager

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

- All Implemented Interfaces:
    ApplicationObject<ServerContext>, CloseableComponent, Initializable, SimpleLogSupport, Dumpable, PermissionControlled, ServerObject<ServerContext>, java.lang.AutoCloseable

      public class LogChannelManager
      extends AbstractInitializableServerObject<ServerContext>
      implements CloseableComponent, PermissionControlled

  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()`
    `LogChannel` | `getChildLogChannel(java.lang.String chName)` Returns the LogChannel with the given name.
    `LogChannel` | `getLogChannel(java.lang.String chName)`
    `LogChannel` | `getLogChannelFor(SessionId sessId)` Same as `getChildLogChannel(String)`.
    `LogLevel` | `getLogLevel()`
    `LogChannel` | `getMainLogChannel()` Returns the default LogChannel of the server.
    `PermissionDefinition` | `getPermissionDefinition()` Returns an object that identifies a `PermissionControlled` object with a unique name and provides a list of supported assignable permissions.
    `void` | `init()` Performs the initialization of this class.
    `void` | `logMessage(SessionId sessId, LogLevel level, java.lang.Object caller, java.lang.String message, java.lang.Exception e)` Logs a message to the client specific logChannel
    `void` | `setLogLevel(LogLevel logLevel)`
    `void` | `setMaxLinesLimit(int maxLines)` Sets the file-size-limit on all open LogChannels

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

      `checkInitialized, isInitialized, setInitialized, toString`

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

      `checkPermission, getServerConfig, getServerContext, getStatisticManager`

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

      `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

    - #### getPermissionDefinition

          public PermissionDefinition getPermissionDefinition()

      Description copied from interface: `PermissionControlled`
      Returns an object that identifies a `PermissionControlled` object with a unique name and provides a list of supported assignable permissions.
      Specified by:
        `getPermissionDefinition` in interface `PermissionControlled`

    - #### getLogLevel

          public LogLevel getLogLevel()

    - #### getMainLogChannel

          public LogChannel getMainLogChannel()

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

    - #### getChildLogChannel

          public LogChannel getChildLogChannel(java.lang.String chName)
                                        throws java.lang.Exception

      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.
      Throws:
        `java.lang.Exception`

    - #### getLogChannel

          public LogChannel getLogChannel(java.lang.String chName)

    - #### getLogChannelFor

          public LogChannel getLogChannelFor(SessionId sessId)

      Same as `getChildLogChannel(String)`. If the sessionId is null then the main LogChannel is returned.

    - #### setLogLevel

          public void setLogLevel(LogLevel logLevel)

    - #### setMaxLinesLimit

          public void setMaxLinesLimit(int maxLines)

      Sets the file-size-limit on all open 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)

      Logs a message to the client specific logChannel

    - #### init

          public void init()

      Description copied from interface: `Initializable`
      Performs the initialization of this class. Note that the implementation should maintain an isInitialized flag which must be set when initialization has completed.
      Specified by:
        `init` in interface `Initializable`

    - #### close

          public void close()

      Specified by:
        `close` in interface `java.lang.AutoCloseable`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.