2.4 Logging Message: XML Schema

Logging messages can be represented in XML. This section defines the schema used by all logging messages for which an XML representation has been defined with the exception of the Connect-Time Log. The XML scheme for the Connect-Time Log is defined in section 2.8.

The XML-format log embeds W3C-format logging information inside the "Summary" XML tag. Individual logging fields are also represented using their own XML tags.

If the entity that generates the XML-format logging message (that is, the client) has access to a Content Description, each name/value pair in the Content Description SHOULD be encoded as shown by the "contentdescription" syntax element in the ABNF syntax as shown in the following code example.

The Content Description is a data structure that is provided by Windows Media Services. If no Content Description is available to the client, the "contentdescription" syntax element MUST NOT be included in the XML-format logging message.

If the entity that generates the XML-format logging message (that is, the client) submits additional or custom logging information, it SHOULD be encoded as shown by the "client-logging-data" syntax element in the following ABNF syntax. For an example illustrating submission of custom logging information, see section 3.2.

If no additional logging information is available, the "client-logging-data" syntax element MUST NOT be included in the XML-format logging message.

The XML-format logging syntax is defined using ABNF as shown in the following code example. Although not explicitly shown by the syntax, linear white space, including CR LF sequences, is allowed on each side of XML tags.

 xml-tag = 1*ALPHA
 cd-name = xml-tag
 cd-value = xml-tag
 cd-name-value-pair = "<" cd-name ">"
 cd-value
     "</" cd-name ">" 
  
 contentdescription = "<ContentDescription>"
     *cd-name-value-pair
     "</ContentDescription>"
  
 client-logging-data = "<" xml-tag ">"
     *cdl-name-value-pair
     "</" xml-tag ">"
  
 xml-log = "<XML>"
   "<Summary>" summary-log "</Summary>"
   "<c-ip>" "0.0.0.0" "</c-ip>"
   "<date>" date "</date>"
   "<time>" time "</time>"
   "<c-dns>" c-dns "</c-dns>"
   "<cs-uri-stem>" cs-uri-stem "</cs-uri-stem>"
   "<c-starttime>" c-starttime "</c-starttime>"
   "<x-duration> x-duration "</x-duration>"
   "<c-rate>" c-rate "</c-rate>"
   "<c-status>" c-status "</c-status>"
   "<c-playerid>" c-playerid "<c-playerid>"
   "<c-playerversion>" c-playerversion "</c-playerversion>"
   "<c-playerlanguage>" c-playerlanguage "</c-playerlanguage>"
   "<cs-User-Agent>" cs-User-Agent "</cs-User-Agent>"
   "<cs-Referer>" cs-Referer "<cs-Referer>"
   "<c-hostexe>" c-hostexe "</c-hostexe>"
   "<c-hostexever>" c-hostexever "</c-hostexever>"
   "<c-os>" c-os "</c-os>"
   "<c-osversion>" c-osversion "</c-osversion>"
   "<c-cpu>" c-cpu "</c-cpu>"
   "<filelength>" filelength "</filelength>"
   "<filesize>" filesize "</filesize>"
   "<avgbandwidth>" avgbandwidth "</avgbandwidth>"
   "<protocol>" protocol "</protocol>"
   "<transport>" transport "</transport>"
   "<audiocodec>" audiocodec "</audiocodec>"
   "<videocodec>" videocodec "</videocodec>"
   "<c-channelURL>" c-channelURL "</c-channelURL>"
   "<sc-bytes>" sc-bytes "</sc-bytes>"
   "<c-bytes>" c-bytes "</c-bytes>"
   "<s-pkts-sent>" s-pkts-sent "</s-pkts-sent>"
   "<c-pkts-received>" c-pkts-received "</c-pkts-received>"
   "<c-pkts-lost-client>" c-pkts-lost-client "</c-pkts-lost-client>"
   "<c-pkts-lost-net>" c-pkts-lost-net "</c-pkts-lost-net>"
   "<c-pkts-lost-cont-net>" c-pkts-lost-cont-net "</c-pkts-lost-cont-net>"
   "<c-resendreqs>" c-resendsreqs "</c-resendreqs>"
   "<c-pkts-recovered-ECC>" c-pkts-recovered-ECC "</c-pkts-recovered-ECC>"
   "<c-pkts-recovered-resent>" c-pkts-recovered-resent "</c-pkts-recovered-resent>"
   "<c-buffercount>" c-buffercount "</c-buffercount>"
   "<c-totalbuffertime>" c-totalbuffertime "</c-totalbuffertime>"
   "<c-quality>" c-quality "</c-quality>"
   "<s-ip>" "-" "</s-ip>"
   "<s-dns>" "-" "</s-dns>"
   "<s-totalclients>" "-" "</s-totalclients>"
   "<s-cpu-util>" "-" "</s-cpu-util>"
   "<cs-url>" cs-url "</cs-url>"
   [ contentdescription ]
   *client-logging-data
 "</XML>"

The syntax only defines the ordering of the fields and the XML tag assigned to each field; it does not define how the values of the fields are assigned. The rules governing the values of the individual fields depend on the logging message in which the XML-format syntax is used.

The XML-format logging syntax MUST use the UTF-8 character set, as specified in [RFC3629]. In any fields that specify a URL, such as cs-url, the URL MUST be encoded using percent-encoding, as specified in [RFC3986] section 2.1.

A single dash character (which is represented by U+002D and by "-" in ABNF syntax) MUST be used to indicate that the value is empty—that is, it is either not available or not applicable.

All spaces embedded within a field value MUST be replaced by an underscore character (which is represented by U+005F and by "_" in ABNF syntax). For example, "MPEG Layer-3" would be transformed into "MPEG_Layer-3" in a W3C-format logging message.