|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.api.DebugLogPublisher<FileBasedDebugLogPublisherCfg>
org.opends.server.loggers.debug.TextDebugLogPublisher
public class TextDebugLogPublisher
The debug log publisher implementation that writes debug messages to files on disk. It also maintains the rotation and retention polices of the log files.
Constructor Summary | |
---|---|
TextDebugLogPublisher()
|
Method Summary | |
---|---|
ConfigChangeResult |
applyConfigurationAdd(DebugTargetCfg config)
Adds a new configuration to this add listener. |
ConfigChangeResult |
applyConfigurationChange(FileBasedDebugLogPublisherCfg config)
Applies the configuration changes to this change listener. |
ConfigChangeResult |
applyConfigurationDelete(DebugTargetCfg config)
Deletes an existing configuration from this delete listener. |
void |
close()
Close this publisher. |
DN |
getDN()
Gets the DN of the configuration entry for this debug log publisher. |
static TextDebugLogPublisher |
getStartupTextDebugPublisher(TextWriter writer)
Returns an instance of the text debug log publisher that will print all messages to the provided writer. |
void |
initializeDebugLogPublisher(FileBasedDebugLogPublisherCfg config)
Initializes this debug publisher provider based on the information in the provided debug publisher configuration. |
boolean |
isConfigurationAcceptable(DebugLogPublisherCfg configuration,
java.util.List<Message> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this debug log publisher. |
boolean |
isConfigurationAddAcceptable(DebugTargetCfg config,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed addition of a new configuration is acceptable to this add listener. |
boolean |
isConfigurationChangeAcceptable(FileBasedDebugLogPublisherCfg config,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener. |
boolean |
isConfigurationDeleteAcceptable(DebugTargetCfg config,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener. |
void |
traceCaught(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Throwable ex,
java.lang.StackTraceElement[] stackTrace)
Log a caught exception in a method. |
void |
traceConstructor(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Object[] args,
java.lang.StackTraceElement[] stackTrace)
Log a constructor entry. |
void |
traceData(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
byte[] data,
java.lang.StackTraceElement[] stackTrace)
Log raw data in a method. |
void |
traceJEAccess(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
com.sleepycat.je.OperationStatus status,
com.sleepycat.je.Database database,
com.sleepycat.je.Transaction txn,
com.sleepycat.je.DatabaseEntry key,
com.sleepycat.je.DatabaseEntry data,
java.lang.StackTraceElement[] stackTrace)
Log an JE database access in a method. |
void |
traceMessage(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.String msg,
java.lang.StackTraceElement[] stackTrace)
Log an arbitrary event in a method. |
void |
traceMethodEntry(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Object obj,
java.lang.Object[] args,
java.lang.StackTraceElement[] stackTrace)
Log a non-static method entry. |
void |
traceProtocolElement(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
ProtocolElement element,
java.lang.StackTraceElement[] stackTrace)
Log a protocol element in a method. |
void |
traceReturn(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Object ret,
java.lang.StackTraceElement[] stackTrace)
Log a method return. |
void |
traceStaticMethodEntry(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Object[] args,
java.lang.StackTraceElement[] stackTrace)
Log a static method entry. |
void |
traceThrown(LogLevel level,
TraceSettings settings,
java.lang.String signature,
java.lang.String sourceLocation,
java.lang.Throwable ex,
java.lang.StackTraceElement[] stackTrace)
Log a thrown exception in a method. |
Methods inherited from class org.opends.server.api.DebugLogPublisher |
---|
addTraceSettings, getClassSettings, getMethodSettings, getTraceSettings, removeTraceSettings |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextDebugLogPublisher()
Method Detail |
---|
public static TextDebugLogPublisher getStartupTextDebugPublisher(TextWriter writer)
writer
- The text writer where the message will be written to.
public boolean isConfigurationAcceptable(DebugLogPublisherCfg configuration, java.util.List<Message> unacceptableReasons)
isConfigurationAcceptable
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
configuration
- The debug log publisher
configuration for which to make the
determination.unacceptableReasons
- A list that may be used to hold the
reasons that the provided
configuration is not acceptable.
true
if the provided configuration is acceptable
for this debug log publisher, or false
if not.public void initializeDebugLogPublisher(FileBasedDebugLogPublisherCfg config) throws ConfigException, InitializationException
initializeDebugLogPublisher
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
config
- The debug publisher configuration that contains
the information to use to initialize this debug
publisher.
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.public boolean isConfigurationChangeAcceptable(FileBasedDebugLogPublisherCfg config, java.util.List<Message> unacceptableReasons)
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<FileBasedDebugLogPublisherCfg>
config
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.
true
if the proposed change is
acceptable, or false
if it is not.public ConfigChangeResult applyConfigurationChange(FileBasedDebugLogPublisherCfg config)
applyConfigurationChange
in interface ConfigurationChangeListener<FileBasedDebugLogPublisherCfg>
config
- The new configuration containing the changes.
public boolean isConfigurationAddAcceptable(DebugTargetCfg config, java.util.List<Message> unacceptableReasons)
isConfigurationAddAcceptable
in interface ConfigurationAddListener<DebugTargetCfg>
config
- The configuration that will be added.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.
true
if the proposed addition is
acceptable, or false
if it is not.public boolean isConfigurationDeleteAcceptable(DebugTargetCfg config, java.util.List<Message> unacceptableReasons)
isConfigurationDeleteAcceptable
in interface ConfigurationDeleteListener<DebugTargetCfg>
config
- The configuration that will be deleted.unacceptableReasons
- A list that can be used to hold messages about why the
provided configuration is not acceptable.
true
if the proposed deletion is
acceptable, or false
if it is not.public ConfigChangeResult applyConfigurationAdd(DebugTargetCfg config)
applyConfigurationAdd
in interface ConfigurationAddListener<DebugTargetCfg>
config
- The configuration that will be added.
public ConfigChangeResult applyConfigurationDelete(DebugTargetCfg config)
applyConfigurationDelete
in interface ConfigurationDeleteListener<DebugTargetCfg>
config
- The existing configuration that will be deleted.
public void traceConstructor(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Object[] args, java.lang.StackTraceElement[] stackTrace)
traceConstructor
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The constuctor signature.sourceLocation
- The location of the method in the source.args
- The parameters provided to the
constructor.stackTrace
- The stack trace at the time the
constructor is executed or null if its
not available.public void traceMethodEntry(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Object obj, java.lang.Object[] args, java.lang.StackTraceElement[] stackTrace)
traceMethodEntry
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.obj
- The object instance on which the method
has been invoked.args
- The parameters provided to the method.stackTrace
- The stack trace at the time the method
is executed or null if its not available.public void traceStaticMethodEntry(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Object[] args, java.lang.StackTraceElement[] stackTrace)
traceStaticMethodEntry
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.args
- The parameters provided to the method.stackTrace
- The stack trace at the time the method
is executed or null if its not available.public void traceReturn(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Object ret, java.lang.StackTraceElement[] stackTrace)
traceReturn
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.ret
- The return value for the method.stackTrace
- The stack trace at the time the method
is returned or null if its not available.public void traceThrown(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Throwable ex, java.lang.StackTraceElement[] stackTrace)
traceThrown
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.ex
- The exception that was thrown.stackTrace
- The stack trace at the time the exception
is thrown or null if its not available.public void traceMessage(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.String msg, java.lang.StackTraceElement[] stackTrace)
traceMessage
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.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.public void traceCaught(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, java.lang.Throwable ex, java.lang.StackTraceElement[] stackTrace)
traceCaught
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.ex
- The exception that was caught.stackTrace
- The stack trace at the time the exception
is caught or null if its not available.public void traceJEAccess(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, com.sleepycat.je.OperationStatus status, com.sleepycat.je.Database database, com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, com.sleepycat.je.DatabaseEntry data, java.lang.StackTraceElement[] stackTrace)
traceJEAccess
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.status
- The status of the JE operation.database
- The database handle.txn
- The transaction handle (may be
null
).key
- The key to dump.data
- The data to dump.stackTrace
- The stack trace at the time the access
occurred or null if its not available.public void traceData(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, byte[] data, java.lang.StackTraceElement[] stackTrace)
traceData
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.data
- The data to dump.stackTrace
- The stack trace at the time the data
is logged or null if its not available.public void traceProtocolElement(LogLevel level, TraceSettings settings, java.lang.String signature, java.lang.String sourceLocation, ProtocolElement element, java.lang.StackTraceElement[] stackTrace)
traceProtocolElement
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
level
- The log level for the message.settings
- The current trace settings in effect.signature
- The method signature.sourceLocation
- The location of the method in the source.element
- The protocol element to dump.stackTrace
- The stack trace at the time the protocol
element is logged or null if its not
available.public void close()
close
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
public DN getDN()
getDN
in class DebugLogPublisher<FileBasedDebugLogPublisherCfg>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |