I'm trying to get a simple log/email alert to fire in Marklogic and am following the examples in the documentation. However I cannot seem to execute an action.
My steps:
[1] create config and insert.
[2] create action and insert.
[3] create rule and insert.
내 경고 조치는 xdmp:log("some message", "alert")
과 같이 간단합니다. 내가 log.xqy
을 만들고 그것을 모듈 dB에로드했습니다. 내가 alert:invoke-matching-actions("config uri", fn:doc("/mydocs/doc.xml"),)
을 호출 할 때. 경고 조치가 내 로그에 기록 될 것으로 기대하지만 그렇지 않습니다. 의미있는 디버깅을 할 수 없습니다.Mark Logic의 간단한 문서로드시 발생하는 로그 경고를 어떻게 시작합니까?
(:_________**set up config**___________________:)
xquery version "1.0-ml";
import module namespace alert = "http://marklogic.com/xdmp/alert"
at "/MarkLogic/alert.xqy";
let $config := alert:make-config(
"test-config-uri",
"test-config-name",
"Alerting config for test",
`<alert:options/>`
)
return alert:config-insert($config);
(:_______**set up action**___________________:)
xquery version "1.0-ml";
import module namespace alert = "http://marklogic.com/xdmp/alert"
at "/MarkLogic/alert.xqy";
let $action := alert:make-action(
"test-action-xdmp:log",
"log to ErrorLog.txt",
xdmp:modules-database(),
xdmp:modules-root(),
"/modules/alert/log.xqy",
`<alert:options>`content modified`</alert:options>`
)
return alert:action-insert("test-config-uri", $action);
(:_____**create rule**____________________:)
xquery version "1.0-ml";
import module namespace alert = "http://marklogic.com/xdmp/alert"
at "/MarkLogic/alert.xqy";
let $rule := alert:make-rule(
"test-rule-name",
"test-rule-name-desc",
0,
cts:word-query("Radiohead"),
"test-action-xdmp:log",
`<alert:options/>`
)
return alert:rule-insert("test-config-uri", $rule);
(:_______**run rule against content**____________________:)
xquery version "1.0-ml";
import module namespace alert = "http://marklogic.com/xdmp/alert"
at "/MarkLogic/alert.xqy";
alert:invoke-matching-actions("test-config-uri",
<doc>Radiohead</doc>, <options/>);
(:_______**log.xqy**_______________________________:)
xquery version "1.0-ml";
let $msg := "Content was modified. New update alert. "
let $level := "alert"
return xdmp:log($msg, $level);
위에 나열된 모든 단계에 대해 코드 및 구성 샘플을 포함하십시오. 문서 데이터베이스 이름뿐만 아니라 구성된 트리거 데이터베이스와 트리거에 사용중인 모듈 데이터베이스도 포함하십시오. 여기에는 꽤 많은 움직이는 조각들이 있습니다 - 위의 모든 것에 대해 명확한 선행이 있으면 다른 사람들이 여러분을보다 쉽게 도울 수 있습니다. –
콘텐츠 dB : 음악 (기본 사양으로 생성) 및 기본 모듈 및 트리거 dB를 사용합니다. – Dee
게시물에 모두 서식을 지정하십시오. 의견을 따르는 것은 쉽지 않습니다. –