Package org.opends.server.loggers
Class ConsoleDebugLogPublisher
- java.lang.Object
-
- org.opends.server.loggers.DebugLogPublisher<DebugLogPublisherCfg>
-
- org.opends.server.loggers.ConsoleDebugLogPublisher
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,LogPublisher<DebugLogPublisherCfg>
public class ConsoleDebugLogPublisher extends DebugLogPublisher<DebugLogPublisherCfg>
The debug log publisher implementation that writes debug messages in a friendly for console output.
-
-
Constructor Summary
Constructors Constructor Description ConsoleDebugLogPublisher(PrintStream err)
Constructs a new ConsoleDebugLogPublisher that writes debug messages to the given PrintStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close this publisher.Dn
getDN()
Gets the DN of the configuration entry for this log publisher.void
initializeLogPublisher(DebugLogPublisherCfg config, ServerContext serverContext)
Initializes this publisher provider based on the information in the provided debug publisher configuration.void
trace(TraceSettings settings, String signature, String sourceLocation, String msg, StackTraceElement[] stackTrace)
Log an arbitrary event in a method.void
traceException(TraceSettings settings, String signature, String sourceLocation, String msg, Throwable ex, StackTraceElement[] stackTrace)
Log a caught exception in a method.-
Methods inherited from class org.opends.server.loggers.DebugLogPublisher
isConfigurationAcceptable
-
-
-
-
Constructor Detail
-
ConsoleDebugLogPublisher
public ConsoleDebugLogPublisher(PrintStream err)
Constructs a new ConsoleDebugLogPublisher that writes debug messages to the given PrintStream.- Parameters:
err
- The PrintStream to write messages to.
-
-
Method Detail
-
initializeLogPublisher
public void initializeLogPublisher(DebugLogPublisherCfg config, ServerContext serverContext)
Description copied from interface:LogPublisher
Initializes this publisher provider based on the information in the provided debug publisher configuration.- Parameters:
config
- The publisher configuration that contains the information to use to initialize this publisher.serverContext
- The server context.
-
trace
public void trace(TraceSettings settings, String signature, String sourceLocation, String msg, StackTraceElement[] stackTrace)
Description copied from class:DebugLogPublisher
Log an arbitrary event in a method.- Specified by:
trace
in classDebugLogPublisher<DebugLogPublisherCfg>
- Parameters:
settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.msg
- The message to be logged.stackTrace
- The stack trace at the time the message is logged or null if its not available.
-
traceException
public void traceException(TraceSettings settings, String signature, String sourceLocation, String msg, Throwable ex, StackTraceElement[] stackTrace)
Description copied from class:DebugLogPublisher
Log a caught exception in a method.- Specified by:
traceException
in classDebugLogPublisher<DebugLogPublisherCfg>
- Parameters:
settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.msg
- The message to be logged.ex
- The exception that was caught.stackTrace
- The stack trace at the time the exception is caught or null if its not available.
-
close
public void close()
Description copied from interface:LogPublisher
Close this publisher.
-
getDN
public Dn getDN()
Description copied from interface:LogPublisher
Gets the DN of the configuration entry for this log publisher.- Returns:
- The configuration entry DN.
-
-