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 voidclose()Close this publisher.DNgetDN()Gets the DN of the configuration entry for this log publisher.voidinitializeLogPublisher(DebugLogPublisherCfg config, ServerContext serverContext)Initializes this publisher provider based on the information in the provided debug publisher configuration.voidtrace(TraceSettings settings, String signature, String sourceLocation, String msg, StackTraceElement[] stackTrace)Log an arbitrary event in a method.voidtraceException(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
addTraceSettings, 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) throws ConfigException, InitializationException
Description copied from interface:LogPublisherInitializes 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.- Throws:
ConfigException- If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.InitializationException- If a problem occurs during initialization that is not related to the server configuration.
-
trace
public void trace(TraceSettings settings, String signature, String sourceLocation, String msg, StackTraceElement[] stackTrace)
Description copied from class:DebugLogPublisherLog an arbitrary event in a method.- Specified by:
tracein 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:DebugLogPublisherLog a caught exception in a method.- Specified by:
traceExceptionin 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:LogPublisherClose this publisher.
-
getDN
public DN getDN()
Description copied from interface:LogPublisherGets the DN of the configuration entry for this log publisher.- Returns:
- The configuration entry DN.
-
-