Public Member Functions | |
LogConfig () | |
void | setCDB (DALOperations cdb) |
void | setCDBLoggingConfigPath (String path) |
void | setCDBComponentPath (String compLoggerName, String path) |
void | initialize (boolean cdbBeatsProperties) throws LogConfigException |
String | getCentralizedLogger () |
int | getDispatchPacketSize () |
AcsLogLevelDefinition | getImmediateDispatchLevel () |
int | getFlushPeriodSeconds () |
int | getMaxLogQueueSize () |
AcsLogLevelDefinition | getDefaultMinLogLevelLocal () |
void | setDefaultMinLogLevelLocal (AcsLogLevelDefinition newLevel) |
AcsLogLevelDefinition | getDefaultMinLogLevel () |
void | setDefaultMinLogLevel (AcsLogLevelDefinition newLevel) |
Set< String > | getLoggerNames () |
boolean | isKnownLogger (String loggerName) |
boolean | hasCustomConfig (String loggerName) |
LockableUnnamedLogger | getNamedLoggerConfig (String loggerName) |
void | setNamedLoggerConfig (String loggerName, LockableUnnamedLogger config) throws AcsJIllegalArgumentEx |
void | setNamedLoggerConfig (String loggerName, UnnamedLogger config) throws AcsJIllegalArgumentEx |
void | clearNamedLoggerConfig (String loggerName) |
void | setMinLogLevelLocal (AcsLogLevelDefinition newLevel, String loggerName) |
void | setMinLogLevel (AcsLogLevelDefinition newLevel, String loggerName) |
void | setAndLockMinLogLevel (AcsLogLevelDefinition newLevel, String loggerName) |
boolean | renameNamedLoggerConfig (String oldLoggerName, String newLoggerName) |
void | addSubscriber (LogConfigSubscriber subscriber) |
void | removeSubscriber (LogConfigSubscriber subscriber) |
void | setInternalLogger (Logger logger) |
Static Public Attributes | |
final String | PROPERTYNAME_MIN_LOG_LEVEL_LOCAL = "ACS.logstdout" |
final String | PROPERTYNAME_MIN_LOG_LEVEL = "ACS.log.minlevel.remote" |
Protected Member Functions | |
void | log (Level level, String msg, Throwable thr) |
Package Functions | |
String | getLogConfigXml (String cdbPathParent, String xpathLogConfigNode) throws CDBXMLErrorEx, CDBRecordDoesNotExistEx, ParserConfigurationException, SAXException, IOException, XPathExpressionException, TransformerException |
void | notifySubscribers () |
Static Package Attributes | |
final String | CDBNAME_LoggingConfig = LoggingConfig.class.getSimpleName() |
final String | CDBNAME_ComponentLogger = "ComponentLogger" |
Private Member Functions | |
void | configureDefaultLevelsFromProperties () |
AcsLogLevelDefinition | convertLegalLogLevel (LogLevel legalLogLevel) |
void | storeNamedLoggerConfig (String loggerName, LockableUnnamedLogger config) |
Private Attributes | |
Logger | logger |
DALOperations | cdb |
String | cdbLoggingConfigPath |
Map< String, String > | cdbComponentPaths |
LoggingConfig | loggingConfig |
final Map< String, LockableUnnamedLogger > | namedLoggerConfigs |
final List< LogConfigSubscriber > | subscriberList |
|
|
|
|
|
Clears log level settings for the given named logger, so that it uses default log levels. Notifies all listeners. Ignores this call if |
|
Reads the properties |
|
Helper method that converts an integer log level to the matching enum literal. It suppresses the AcsJIllegalArgumentEx because the level must have been validated during the config init (and we wouldn't be bothered about exceptions here if we had stored the converted enum literal instead of the castor class). Therefore a lame log and runtime ex are thrown just in case, but no AcsJIllegalArgumentEx gets thrown on. |
|
|
|
Gets the log level for centralized logging for default loggers (those that don't have custom levels set). |
|
Gets the log level for stdout printing for default loggers (those that don't have custom levels set). |
|
|
|
|
|
|
|
Reads the CDB element from the given path as XML, and extracts the child element that must be uniquely identified by the XPath expression in TODO: move the Node-to-XML-String code to a general utility package and return just the Node -- any client can then easily turn it into a String if needed. For Castor-parsing, a node is fine, see Unmarshaller#unmarshal(Node).
|
|
Gets the names of all known loggers, no matter if they use default or custom levels. The loggers are registered automatically by calls to getNamedLoggerConfig(String) and setNamedLoggerConfig(String, UnnamedLogger). |
|
|
|
Gets the (log level) configuration data for a named logger. Resorts to the default configuration if a specialized configuration is not available. Note that a copy of the config data is returned, so changes to it will not affect any other object's configuration. A previously unknown logger gets registered by its name. If this is not intended, check first with isKnownLogger(String). |
|
Checks if there is a level configuration for this particular logger.
|
|
Initializes the values based on CDB settings, logging properties, etc. All subscribing classes are notified of the new configuration, see LogConfigSubscriber#configureLogging(LogConfig). This method can be called more than once: if some settings have changed, should be read in, and the logging classes should be notified of these changes. For example, the container could call this method when it gets notified that the logging configuration in the CDB has been changed at runtime.
|
|
Checks if the given logger name is known, either for default or custom config. The current LoggingConfigurable interface semantics don't allow configuration of a logger that does not yet exist. Therefore this method can be used to check first before calling getNamedLoggerConfig(String) or setNamedLoggerConfig(String, alma.acs.logging.config.LogConfig.LockableUnnamedLogger), which would automatically add a previously unknown logger.
|
|
Logs to the Logger given in setInternalLogger(Logger), or to System.out if no Logger has been provided. |
|
|
|
|
|
Renaming of a logger can occur for example when an ORB logger undergoes a name change as soon as the process name is determined by the container logger. Renaming is not a regular part of a logger's life though. By the time that tools can look at the list of loggers, no renaming should occur any more.
|
|
Locking a remote log level is currently needed only for the container to ensure that the ORB logger of the container in which the archive logger component runs is guaranteed to not produce any logs (which would lead to log record explosion through positive feedback). The more abstract concept of locking log levels was chosen to keep the special scenario described above out of the logging config code.
|
|
Sets the reference to the CDB, which will then be used for configuration. Before this method is called, default values are used instead of CDB values. Note that the reference is only set, but the CDB is not read automatically; for this, call initialize(boolean).
|
|
Sets the path to the CDB's node that is parent of the <log:UnnamedLogger/> component logger node. This call does not access the CDB.
|
|
Sets the path to the CDB's node that is parent of the <LoggingConfig> node, such as a container or the manager node. This call does not access the CDB.
|
|
Sets the given log level for centralized logging of log records for all loggers that don't have a custom configuration. All log config listeners.get notified of this change. The call is ignored for negative values of
|
|
Sets the given log level for stdout printing of log records for all loggers that don't have a custom configuration. All log config listeners.get notified of this change. The call is ignored for negative values of
|
|
Sets the Logger to be used by this class and dependent classes for internal tracing. Note that in the current design of ClientLogManager and LogConfig, the Logger can not be provided already in the constructor, because the Logger first must be configured, which in turn requires a LogConfig instance. That's why we have this setter method. |
|
|
|
|
|
We keep this method next to setNamedLoggerConfig(String, alma.acs.logging.config.LogConfig.LockableUnnamedLogger) in order to keep the LockableUnnamedLogger confined to this class. It may be exposed later, and this method could then be removed.
|
|
Sets the given log levels for the named logger and notifies all listeners. Ignores this call if any of the parameters are
A copy of the supplied
If
|
|
Method that guards
|
|
The ACS CDB. This value is null unless it gets set in setCDB(DAL). |
|
Paths in the CDB to the element that contains component configuration with child elements of type This only applies to container log config, since for example the manager logging config does not deal with components. |
|
Path in the CDB to the element (container, manager etc) that contains a |
|
In CDB queries for the
In the schema |
|
In CDB queries for the For type safety we get that name from the schema-generated castor class. |
|
The logger for messages logged by this class. Note that this field will be null at first, until the Logger gets provided, so better use log(Level, String, Throwable) for safe access. |
|
The schema-generated logging config, either with default values, or read from the CDB. The log levels can also be changed by properties (env var peers) and dynamically. |
|
Logger names and optionally associated log levels. Loggers that use default levels are stored with their name (map key), but a null value for the configuration is associated with them. Actual named logger configurations are stored as the map values, and can come from
key = [String] logger name, value = [LockableUnnamedLogger or null] level config |
|
|
|
|
|
Subscribers get notified of logging config changes |