You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Work in progress

This page is work in progress

 

Java Broker Logging

We plan to reimplement logging within the Java Broker, bringing logging configuration into the Configured Object Model

Requirements

  1. Ability to produce a broker wide log which may or may not include the activity of virtual hosts
  2. Ability to produce separate logs for each virtualhost
  3. Ability to assign/change the level of any logger at runtime.  It will be possible to assign the logging level on a logger related to a class e.g. o.a.q.X or hierarchy e.g. o.a.q.
  4. Logger levels can be assigned durably or non-durable.  Those durable will survive a restart.
  5. Ability to assign different logger levels for different virtual hosts.
  6. Ability to logs to different destinations, e.g.
    1. to a plain file on the filesystem
    2. to a stream
    3. to a bounded buffer
  7. Logging configuration will be persisted to the Broker/Virtualhost configuration stores.  As such in the HA use-case, the same logging configuration will be applied to all nodes within a HA group.
  8. Ability to configure file rolling and compression
  9. Ability to configure logging and view logs from Web Management Console, REST API and later AMQP management.
  10. Ability to limit who may configure logging or who may view logs via the Management interfaces.

Do we want the ability to view a log file that is on disk from Management, or is the ability to view the log messages within the bounded buffer recorder sufficient?

High Level Design

The Broker and Virtualhost will have one or more LogRecorders and zero or more LogFilters.

  • LogRecorders are responsible for writing the log itself. There will be different implementations of LogRecorder that will be responsible for writing to files, streams and maintain a bounded buffer of log messages for inspection on-line.
  • LogFilters determine if a particular log event is to appear in the log.

Proposed Configured Object Model

ConfigModelShowingProposedLoggingObjects

Class Diagram

 

Broker-Virtualhost

LogFilter

Associates a logger with a logging level.

When considering whether a logging event should be written, the implementation will check for a LogFilter with a matching logger, if it exists the level of the log event is compared against the level of the filter.  If the level of the event is higher or equal to that of the level filter, the logging event will be written.  If there is no matching log filter, the implementation will check for a filter for the logger's parent and then make the same determination.  If this fails to find a filter, this will continue until the root it reached.  If this occurs, the determination will be made against the level associated with the Broker or Virtualhost itself.

Adding (or removing) a LogLevel will have an immediate effect on what appears in the logs. If the LogLevel is durable, as is common with all configured objects, the object will be stored in the configuration store, so it will be effective on restart.

 

LogLevel

 

 

 

  • No labels