Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Spell Checked

...

At this stage configuration will be limited to the addtion addition to the main config.xml file of the following option:

...

In the first phase updates only stauts status updates will be provided. Status updates should take the form of general operational logging level, no logging on message delivery path way and No performance impact. The recommendation will be to have these enabled for production use.
e.g. Creation/Destruction events

...

The approach to logging is that each Entitiy as highlighted on Logging Format Design would provide an implementation of MessageStatusLogger. This logger would be obtained from the MessagesStatusLoggerFactory during the constuction construction of the entity. When a Status event occured occurred that should be logged a LogActor is requried required to request the logging. The initial _LogActor_s would be Connection, Channel and Subscription. Later phases would introduce VirtualHost and ManagementConnection. These Actors will initially only be used to provide their log formated formatted name as per the format design. However, later their details can be used to identify if logging should procced proceed for that Actor and Entity combination. At this stage selective configurations is not part of this design.

...

No Format
2009-06-29 13:35:10,1234 +0100 MESSAEGMESSAGE [ con:1(guest@127.0.0.1/)/ch:2/ex(amq.direct)/qu(testQueue)/bd(routingKey) ] BND-1001 : Binding Created

rather having no details about how the creation occuredoccurred:

No Format
2009-06-29 13:35:10,1234 +0100 MESSAGE [ vh(/)/ex(amq.direct)/qu(testQueue)/bd(routingKey) ] BDN-1001 : Binding Created

...

Code Block
java
java
titleLogActor

/**
 * LogActor the entity that is requesting the log to be peformedperformed.
 *
 * The actor is responsible for providing the formatted name for the log entry.
 *
 */
public interface LogActor
{
    /**
     * Return the String that this actor wishes to be entered into the logfile.
     *
     * @return String
     */
    public String getLogFormattedName();
}
Code Block
java
java
titleMessageStatusLogger
/**
 * Message Status messages are logged via this interface.
 *
 * Each Entity that wishes to be logged will implement this to provide their
 * own display representation.
 *
 * The MSLogger will be created by a Factory {@see MessageStatusLoggerFactory}.
 *
 * Currently logging has a global setting however this will later be revised and
 * as such the LogActor will need to be taken in to consideration as well as the
 * status of this Logger.
 *
 * A detailed and published list of messages that will be logged will be
 * provided so that monitoring systems can know what to expect.
 */
public interface MessageStatusLogger
{

    /**
     * This method should be used as a guard against expensive message
     * construction prior to calling message().
     *
     * It should not be called if there is no construction required.
     *
     * This will perform validation that the log message should be performed
     * based on the provided Actor and the Entity this Logger represents.
     * This may be done via delegation to the RootMessageStatusLogger.
     *
     * @param actor The actor that is requesting to perform logging
     *
     * @return if this log message should take place
     */
    public boolean isMessageEnabled(LogActor actor);

    /**
     * Logs the message as provided by String.valueOf(message).
     *
     * The call to message() will first check if #isMessageEnabled() allows
     * the logging to be performed. This means for simple messages it is not
     * necessary to guard this call with isMessageEnabled() as it will be called
     * internally.
     *
     * If any complex construction is requriedrequired then it MUST BE guarded so that
     * the log message is not needlessly generated.
     *
     * @param actor   The actor that is requesting the logging
     * @param message The message to log
     */
    public void message(LogActor actor, Object message);

    /**
     * Logs the message as provided by String.valueOf(message).
     *
     * The call to message() will first check if #isMessageEnabled() allows
     * the logging to be performed. This means for simple messages it is not
     * necessary to guard this call with isMessageEnabled() as it will be called
     * internally.
     *
     * If any complex construction is requriedrequired then it MUST BE guarded so that
     * the log message is not needlessly generated.
     *
     * If the provided Throwable is non-null then the stack trace will also be
     * logged.
     *
     * @param actor   The actor that is requesting the logging
     * @param message The message to log
     * @param throwable The throwable that should be used to generate a trace.
     */
    public void message(LogActor actor, Object message, Throwable throwable);
}

...

Code Block
java
java
titleRawMessageLogger
/**
 * A RawMessage Logger takes the given String and any Throwable and writes the
 * data to its resouceresource.
 */
public interface RawMessageLogger
{
    /**
     * Log the message and formatted stack trace for any Throwable.
     *
     * @param message   String to log.
     * @param throwable Throwable for which to provide stack trace.
     */
    public void rawMessage(String message, Throwable throwable);
}

...