<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/fn.trace.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>fn.trace</api:function-name><api:suggest>fn.trace</api:suggest><api:suggest>fn</api:suggest><api:suggest>trace</api:suggest><api:function-link mode="xquery" fullname="fn:trace">/apidoc/8.0/fn:trace.xml</api:function-link><api:function mode="javascript" name="trace" type="builtin" lib="fn" category="Error and Trace" bucket="W3C-Standard Functions" hidden="false" prefix="fn" namespace="http://www.w3.org/2005/xpath-functions" fullname="fn.trace"><api:summary>
  Return the input $value unchanged and, if $label is the name of
  an enabled server event, emit that server event to the server log
  file (<code xmlns="http://www.w3.org/1999/xhtml">ErrorLog.txt</code>) with $value as its data.
</api:summary><api:params><api:param name="value" type="item()*"><api:param-description>
   The values to trace.
  </api:param-description><api:param-name>value</api:param-name><api:param-type>ValueIterator</api:param-type></api:param><api:param name="label" type="xs:string"><api:param-description>
   A string label for the trace output.
  </api:param-description><api:param-name>label</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:usage>
  In order for the trace event to print out in the log file, you must enable 
  the trace event in the Diagnostics page (Groups &gt; <em xmlns="http://www.w3.org/1999/xhtml">group_name</em> &gt; 
  Diagnostics ) of the Admin interface for the specified label.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
fn.trace("This is a trace event.", "MY TRACE EVENT")

=&gt; If MY TRACE EVENT is defined as an enabled trace event
   in the Diagnostics page of the Admin interface, then a
   message similar to the following is added to the 
   ErrorLog.txt file:

   2015-03-20 17:56:09.346 Info: [Event:id=MY TRACE EVENT] 
                                 This is a trace event.
</pre>
</api:example></api:function></api:function-page>