Open adamfowleruk opened 8 years ago
curl -X PUT --anyauth --user admin:admin --header "Content-Type:application/json" -d'{"group-name":"Default","events-activated":true,"event":["marklogicworkflow.actions","marklogicworkflow.alerts"]}' http://localhost:8002/manage/v2/groups/Default/properties
What do you think about doing something along the lines of what's below? Unfortunately it doesn't look like you can set the log levels using the REST API but it's easily done in the admin console.
declare variable $DEBUG-LEVELS := ("finest","finer","fine","debug"); declare variable $DEBUG := xdmp:log-level() = $DEBUG-LEVELS; ... let $_ := if ($DEBUG) then xdmp:trace("marklogicworkflow.actions", "Running Action 1") else ()
prefix all trace events with the name of your app (which presumably is or can be shortened to an acronym). Just helps make it obvious that you own them and they’re specific to your app.
define all of your trace events as constants in an sjs/xqy library.
documentation: can always set trace events via the command line so you don’t have to click click click around the Admin UI:
gradle –Pevents=abc-event1,abc-event2,some-other-event,etc mlSetTraceEvents
To support multiple log levels