Loading TOC...

xdmp:trace-enabled

xdmp:trace-enabled(
   $name as xs:string
) as xs:boolean

Summary

Returns whether or not a trace event is enabled.

Parameters
$name The trace event name.

Example

xquery version "1.0-ml";
let $query := cts:word-query("hello")
return
  if (xdmp:trace-enabled("Query Trace")) 
  then xdmp:log($query)
  else ()

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • How can I enable a specific trace event from the config file? Thanks
    • I'm not sure what you mean by "from the config file." Could you clarify, please?
      • I want the trace events to be added at bootstrap time, not through the admin api, and I don't know how to specify the trace events in ml-config.xml
        • Ah, this is a Roxy question. I don't think Roxy currently supports enabling specific trace events, just turning on the trace feature. You could file that as an issue on Roxy's GitHub page: https://github.com/marklogic-community/roxy