%ents; ]>
Event Logging over XMPP This specification provides a common framework for sending events to event logs over XMPP networks. This XMPP Extension Protocol is copyright (c) 1999 - 2013 by the XMPP Standards Foundation (XSF). Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation. ## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ## In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages. This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA). xxxx ProtoXEP Standards Track Standards Council XMPP Core XEP-0001 eventlog Peter Waher peter.waher@clayster.com peter.waher@jabber.org http://www.linkedin.com/in/peterwaher 0.0.1 2013-11-10 pw

First draft.

This XEP provides a common framework for sending events over an XMPP network. These events can then be logged in event logs or analyzed by network monitors to analyze the status or operation of the network and its participants.

The basic principle behind interoperable event logging over XMPP is the definition of a common XML element defining the event. This payload is then sent in a normal message stanza (i.e. with type='normal') to the recipient. The recipient in turn, if it understands the payload, can choose to store it in an event log, forward it or analyze it accordingly.

There are various event log packages available, but none yet defined for XMPP or using a well defined and known XML format. Therefore, this document defines such an XML format. This format is able to store Syslog RFC-5424: The Syslog Protocol <https://tools.ietf.org/html/rfc5424> compliant event information, even though the Syslog event model has been somewhat extended.

The following table lists common terms and corresponding descriptions.

Event
A piece of information describing an event in time.
Event ID
An attribute providing a machine readable ID to the type of event in question without having to parse the message text itself.
Event Level
Provides an additional level on the previous classification (Minor, Medium, Major).
Event Type
Coarse classification of the event (Debug, Informational, Notice, Warning, Error, Critical, Alert, Emergency).
Facility
What type of device, server, application, etc., is sending the message.
Message
A (human readable) text message describing what has occurred.
Module
The module reporting the event. Larger software packages are often divided into modules. Keeping track of which modules report which events can be useful when analyzing system performance.
Object
The object to which the event message refers to, on which the current action is performed.
Stack Trace
Exact position in the code from whice the event was reported or error occurred. Reporting it in a separate attribute unclutters the message, and removes the need to define custom tags.
Subject
The subject causing the event to take place or performing the action (for instance, user, process, etc.)
Tag
A custom tag or parameter attached to an event. Each tag has a name and a value and an optional data type.
Timestamp
When the event occurred.

The following example shows how to send a simple event using a normal message to an event log. There are only two parameters that are required: message and timestamp. This message will be treated as a Minor Informational message by the recipient.

]]>

The following example shows how an event message can be categorized with an event type and level.

]]>

The following example shows how an event message can be further enhanced by providing object and subject information.

]]>

The following example shows how an event message can receive an ID that can be singled out later to be analyzed by administrators, for instance.

]]>

The following example shows how to tag an event using custom information in a way that is easy to interpret and process.

]]>

The following example shows how module information can be provided in events to more easilly be able to single out information relating to the same application running on different machines.

]]>

The following example shows how to send a debug message with a stack trace, module and custom inforation.

]]>

If an entity supports the reception of events as specified herein, it MUST advertise that fact by returning a feature of "urn:xmpp:eventlog" in response to &xep0030; information requests.

]]> ... ... ]]>

In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

The following table lists possible event types that can be used. If none is specified for an event, it is assumed that the event is Informational. It is largely based on the severity levels of Syslog.

Type Description
Debug Developers can ask applications to send debug messages during development or testing to more easily see what happens in a system.
Informational An informational message describing a normal event.
Notice Represents a significant condition or change that administrators should be aware of.
Warning A warning condition. If not taken into account, the condition could turn into an error.
Error An error condition. A condition has been detected that is considered to be an error or a fault.
Critical A ciritical condition. An error so great that it could escalate into something graver if not addressed.
Alert An alert condition. Action must be taken immediately.
Emergency System is unusable.

Given an Event Type, an event level can provide additional information about the extent or importance of the event (a second dimension).

Level Description
Minor Minor events, concerning normal operating procedures.
Medium Medium events.
Major More substantial events or affecting larger parts of the system.

Using Event IDs the application can provide a machine understandable classification of the event. Examples could be "Login"-events, "ConnectionProblem"-events, etc. It is easier to group, parse or interpret events and their tags if you know what type of event it is. Event IDs are manufacturer specific, and only provide a means to more easilly extract subsets of events for processing without having to parse message texts (which should be allowed to be localizable).

Note: To avoid problems when running applications using different locales, event IDs should never be localized.

An event is often linked to an object, i.e. on which object an action was performed, or which object is reporting a condition. The object field permits the tagging of objects in a common way. It is later easy to extract all events relating to a specific object by using this attribute.

An event is often also linked to a subject, i.e. who or what performed a given action resulting in the event or condition. The subject field permits the tagging of subjects in a common way. It is later easy to extract all events relating to a specific subbject by using this attribute.

Facility can be either a facility in the network sense or in the system sense. This document does not restrict its use to the possible choices defined by other protocols such as Syslog, and leaves it open. However, it is left as a special attribute since it is important in monitoring applications.

A module is part of a larger software package. Using the module attribute makes it easier to attribute events to specific parts of a distributed application and analyze them separately.

Stack Traces can be important information to developers and correlate events to actual locations in the code that generated the event. This document does not specify any particular format for stack traces.

Note that stack traces can be divided into multiple lines separated by CRLF. It is important to encode such strings correctly to avoid problems in XML parsers.

Any event can have a custom set of tags attached to it. A tag is required to have a name and a value. It can also optionally specify a datatype. Data Types are specified using Qualified Names (QNames). If possible, they should adher to the list of Data Forms Validation Datatypes Data Forms Validation Datatypes <http://xmpp.org/registrar/xdv-datatypes.html> that is maintained by the XMPP Registrar.

Note: To avoid problems when running applications using different locales, tag names should never be localized.

If persisting received events in a database, care should be taken if normalized tables are used for storage of tags names and values, event IDs, objects, subjects, facilities and modules. If this is the case, the receiver should look for types of values that can be incompatible with normalized tables (such as floating point values or numbers in general, GUIDs, resource names in JIDs etc.) and replace them with some descriptive text and append the corresponding value in the message text instead. This to avoid problems with indexes in databases because of devices implemented by third parties.

It is still valid to send such information (like sequence numbers, unique GUIDs, resource names in JIDs etc., measurements, etc.) in tags names and values, but should be avoided in event IDs, objects, subjects, facilities and modules, as they can cause problems further down the line.

All timestamps and dateTime values use the XML data type xs:dateTime to specify values. These values include a date, an optional time and an optional time zone.

Note: If time zone is not available, it is supposed to be undefined. The recipient of an event message without time zone information should assume the sender has the same time zone as the received, if not explicitly configured otherwise on the recipient side.

If devices report time zone, this information should be propagated throughout the system. Otherwise, comparing timestamps from different time zones will be impossible.

Event messages SHOULD contain an xml:lang attribute on the message stanza to specify the language used in message texts, etc. If language information is not available (for instance, if relaying messages not created by the device itself, the xml:lang attribute can be omitted).

Even though this document permits zero-configuration of devices to event logs, this might not always be the best option. Event information might be sensitive and should not be sent to anybody just because they support the event log feature as defined in this document.

Never log information that should be handled securely or encrypted, such as passwords.

This document requires no interaction with &IANA;.

The protocol schema needs to be added to the list of XMPP protocol schemas.

]]>

Thanks in alphabetical order to Joachim Lindborg, Markus Kohlhase, Matthew Wild, Mike Taylor, Robert Kosten, Steffen Larsen, and Yusuke DOI for all valuable feedback.