# <log>

Description

The `<log>` element allows the application to generate messages for debugging. This element can contain a combination of text and `<value>` elements, and the resulting message will be the concatenation of the text and string value of `<value>` element. The message will be logged to one or more files for viewing, as well as to the page that is sent as an email (if applicable).

In standards compliance mode, a failure to evaluate a `<value>` inside a `<log>` will result in an `error.semantic` event being thrown. If the `com.voicegenie.STRICTCONFORMANCE` property is set to `FALSE`, such `<value>`s will just be ignored.

Syntax

    <log
        expr="ECMAScript_Expression"
        label="string"
        cond="ECMAScript_Expression"
        level="integer"
        dest="dest1 dest2 ..." | "calllog" | "none">
      text
    </log>

Attributes

Attribute | Description
expr | An ECMAScript expression of which the evaluated value will be appended to the `<log>` element content and `label` attribute value. Optional.
label | A string label that will be appended to the `<log>` element content before the value of the `expr` attribute is appended. Optional.
cond | An ECMAScript expression to be evaluated and used as a boolean condition. This log will be executed only if the expression evaluates to `true`. Optional. (Defaults to true.)
level | An integer value that must be less than or equal to the `loglevel` property value for this log to be executed. Optional. (Defaults to 1.)
dest | A space-separated list of files (dest1 .. destn) to which the message generated by this log should be written. Each desti is one of: metrics (`pw_metricsfile` log) syslog (system log) file:path/filename (user defined log file relative to the "logs" directory) callmgr (currently only used with certain integrations/installations) Can also be "none" (log is ignored). You can also set this attribute to "calllog" to control full-call recording. Optional. (Defaults to metrics.)

Parents

<block>, <catch>, <error>, <filled>, <foreach>, <help>, <if>, <noinput>, <nomatch>

Children

<value>, #PCDATA

Extensions

- Added `cond` attribute.
- Added `level` attribute.
- Added `dest` attribute.

Limitations/Restrictions

- `<log>` cannot be used as a child of `<foreach>` when `<foreach>` is a child of `<prompt>`.
- After a call has hung up, information intended to be written to the ScanSoft OSR log via the `<log>` tag for use with OpenSpeech Insight (OSI) will not be sent to the OSR and is thus not available when using OSI.

Example

    <?xml version="1.0"?>
    <vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
      <form>
        <field name="field1" type="boolean">
          <prompt>Please say yes or no.</prompt>
          <filled>
            You said <value expr="field1"/>.
            <log>The user said <value expr="field1"/>.</log>
          </filled>
        </field>
      </form>
    </vxml>