Knowledgebase: Administration
How to use diagnostic trace events
05 June 2023 02:42 PM

Summary

Diagnostic trace events can be particularly useful in situations where you need access to more internal diagnostic information than is available in the standard MarkLogic ErrorLog or in the Operating System logs.

The host / cluster can be configured to output trace events and from the point at which these diagnostics are enabled and added, the server will write information to the ErrorLog every time the diagnostic event is encountered.

Note: Once you have fulfilled your purpose of enabling trace events, make sure you disable them right away as these trace events are fairly verbose and running the server with trace events enabled could slow it down.

Enabling Server trace events

Trace events need to be enabled and added by an administrator using the following steps:

  1. Log into the Admin Interface.
  2. Select Groups > group_name > Diagnostics
  3. The Diagnostics Configuration page appears
  4. Click the true button for trace events activated
  5. Enter the trace event [for example Query Trace] to enable the diagnostic event
  6. Click the OK button to activate the event(s)
  7. Example To verify "Query Trace" trace event set
    1. Open a session in qconsole and execute (something like) the following query:
    2. (xdmp:query-trace(true()), cts:search(doc(), cts:word-query("test")))
    3. Observe the ErrorLog for specific query trace information

Manual trace events

In place of using xdmp:log() you can also create custom trace events. The following steps outline this:

  1. Log into the Admin Interface.
  2. Select Groups > group_name > Diagnostics
  3. The Diagnostics Configuration page appears
  4. Click the true button for trace events activated
  5. Enter the trace event [such as Hello World] to enable the diagnostic event
  6. Click the OK button to activate the event(s)
  7. Example To verify "Hello World" trace event set
    1. Open a session in qconsole and execute the following query:
    2. fn:trace("Here is a 'Hello World' trace event.", "Hello World")
    3. Observe the ErrorLog for specific query trace information

Trace event groups

Adding any of these to your diagnostics will cause the server to output a number of trace events relating to that particular group

  • httpserver
  • xdbcserver
  • forest
  • xqueryeval
  • xdqpserver
  • stand
  • list
  • tree
  • forestlabel
  • relevance
  • lock
  • cluster
  • config
  • module
  • cpf
  • classifier

Further reading

(1 vote(s))
Helpful
Not helpful

Comments (0)