2

I very often use the Errorlog for debugging when i am working on a XQuery in MarkLogic.

The issue is that over a day the log can become quite full and it is annoying to always scroll to the bottom of the log.

Is there maybe a way to quickly clear the errorlog? Since it is for development only it does not matter how to achieve the solution.

I already tried clearing the local file in which the log is stored, but windows 10 won't let me change the content of the file until I stopped the MarkLogic Process.

  • 1
    Have you tried using the`/manage/v2/logs` endoint? https://docs.marklogic.com/REST/GET/manage/v2/logs You can specify `start` time to limit what comes back, and even a `regex` to look for a specific log message. – Mads Hansen May 11 '20 at 11:55

1 Answers1

4

Yeah, you have to stop MarkLogic, clear the log(s), and start MarkLogic up again. You can scripts it, it runs fairly fast.

The script could look something like this:

@echo off

net stop MarkLogic

for %%a in ("C:\Program Files\MarkLogic\Data\Logs\*") do break>%%~fa

net start MarkLogic

Note that this script clears all Files/Logs in the specified directory.

grtjn
  • 20,254
  • 1
  • 24
  • 35