public class TextErrorLogPublisher extends ErrorLogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg> implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
defaultSeverities, definedSeverities
Constructor and Description |
---|
TextErrorLogPublisher() |
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config) |
void |
close()
Close this publisher.
|
org.forgerock.opendj.ldap.Dn |
getDN()
Gets the DN of the configuration entry for this log publisher.
|
static TextErrorLogPublisher |
getServerStartupTextErrorPublisher(TextWriter writer)
Returns a new text error log publisher which will print only notices, severe warnings and errors, and fatal
errors messages to the provided writer.
|
static TextErrorLogPublisher |
getToolStartupTextErrorPublisher(TextWriter writer)
Returns a new text error log publisher which will print all messages to the provided writer.
|
void |
initializeLogPublisher(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config,
ServerContext serverContext)
Initializes this publisher provider based on the information in the provided debug publisher configuration.
|
boolean |
isConfigurationAcceptable(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this log publisher.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config,
List<LocalizableMessage> unacceptableReasons) |
boolean |
isEnabledFor(String category,
Severity severity)
Check if a message should be logged for the provided category and severity.
|
void |
log(String source,
Severity severity,
LocalizableMessage message,
Throwable exception)
Writes a message to the error log using the provided information.
|
public static TextErrorLogPublisher getToolStartupTextErrorPublisher(TextWriter writer)
writer
- The text writer where the message will be written to.public static TextErrorLogPublisher getServerStartupTextErrorPublisher(TextWriter writer)
writer
- The text writer where the message will be written to.public void initializeLogPublisher(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config, ServerContext serverContext) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
LogPublisher
initializeLogPublisher
in interface LogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
config
- The publisher configuration that contains the information to use to initialize this publisher.serverContext
- The server context.org.forgerock.opendj.config.server.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 isConfigurationAcceptable(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)
LogPublisher
isConfigurationAcceptable
in interface LogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
isConfigurationAcceptable
in class ErrorLogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
config
- The 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 log publisher, or false
if not.public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg config)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
public void close()
LogPublisher
close
in interface Closeable
close
in interface AutoCloseable
close
in interface LogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
public void log(String source, Severity severity, LocalizableMessage message, Throwable exception)
ErrorLogPublisher
The category and severity information are used to determine whether to actually log this message.
Category is defined using either short name (used for classes in well defined packages) or fully qualified
classname. Conversion to short name is done automatically when loggers are created, see
LoggingCategoryNames
for list of existing short names.
log
in class ErrorLogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
source
- The category of the message, which is either a classname or a simple category name defined in
LoggingCategoryNames
class.severity
- The severity of the message.message
- The message to be logged.exception
- The exception to be logged. May be null
.public boolean isEnabledFor(String category, Severity severity)
ErrorLogPublisher
isEnabledFor
in class ErrorLogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
category
- The category of the message, which is either a classname or a simple category name defined in
LoggingCategoryNames
class.severity
- The severity of the message.true
if the message should be logged, false
otherwisepublic org.forgerock.opendj.ldap.Dn getDN()
LogPublisher
getDN
in interface LogPublisher<org.forgerock.opendj.server.config.server.FileBasedErrorLogPublisherCfg>
Copyright © 2010–2017 ForgeRock AS. All rights reserved.