Log
Write messages to the rolling log, show and search the logs, view them over time and manage retention and archives. Typical uses: trace the steps of a script, find the cause of an error.
log tracelog writelog showlog current idlog retention daylog removelog archive sizelog archive pathlog resetlog searchlog show_timerestricted show_pid

log trace <text>


Description

    To write a message to the log system

Parameters

    text:   The text - string - required
admin
log trace test;
mentdb
1
Used in use cases (7 recipes)

    MQL developer › Add a language and translate the messages of an application
    Backend & web service developer › Read server parameters and trace a run in the logs
    Execution modes › Context of a run: user, session, pid, traces
    Scheduler developer › Prove a job ran with the log table
    Debugging & error handling › Catch, log and rethrow with context
    System administrator & DevOps › Maintenance window: lock, change the config, reopen
    and 1 more in the Use cases
Often used with

    log show  ·  log archive path  ·  log archive size  ·  log retention day  ·  script create  ·  script delete  ·  string regexp_extract  ·  and

log write <msg> <status> <clientKey> <clientValue>


Description

    To write a message to MySQL

Parameters

    msg:   The message to write - string - required
    status:   The status - string - required
    clientKey:   The client key - string - required
    clientValue:   The client value - string - required
admin
log write "My message ..." OK "cmd" 425;
mentdb
1
Used in use cases (22 recipes)

    Backend & web service developer › Publish a typed web service with its parameter and stack options
    Execution modes › Activity log of a run and its children
    Web service developer › DELETE: idempotent delete with an audit trail
    Async developer › Push a script to the stack and watch it close
    Scheduler developer › Prove a job ran with the log table
    Event developer › Run a script when a file arrives in a folder
    and 16 more in the Use cases
Often used with

    script create  ·  script delete  ·  string substring  ·  date now  ·  execute  ·  and  ·  date sysdate  ·  log search

log show <nbLine>


Description

    To show the last text written to the log system

Parameters

    nbLine:   The number of lines - integer - not required
admin
log show 5;
mentdb
2017-06-05 10:35:42.375+0400: 43 2017-06-05 10:35:42.375+0400: 44 2017-06-05 10:35:42.380+0400: 1: your messffage ... 2017-06-05 10:35:42.896+0400: test
admin
log show
mentdb
2017-06-05 10:35:42.375+0400: 43 2017-06-05 10:35:42.375+0400: 44 2017-06-05 10:35:42.380+0400: 1: your messffage ... 2017-06-05 10:35:42.896+0400: test
Used in use cases (5 recipes)

    Backend & web service developer › Read server parameters and trace a run in the logs
    Execution modes › Context of a run: user, session, pid, traces
    Scheduler developer › Prove a job ran with the log table
    Debugging & error handling › Catch, log and rethrow with context
    Debugging & error handling › Where the logs go: trace, show, ids and retention
Often used with

    log trace  ·  log archive path  ·  log archive size  ·  log retention day  ·  script create  ·  script delete  ·  string regexp_extract  ·  execute

log current id


Description

    To show the current log id

admin
log current id
mentdb
1
Used in use cases (3 recipes)

    Backend & web service developer › Read server parameters and trace a run in the logs
    Debugging & error handling › Where the logs go: trace, show, ids and retention
    System administrator & DevOps › Sessions and errors of the day
Often used with

    log archive path  ·  log archive size  ·  log retention day  ·  date sysdate  ·  log search  ·  log show  ·  log trace  ·  cmdid

log retention day


Description

    To show the log retention in days

admin
log retention day
mentdb
50
Used in use cases (6 recipes)

    Backend & web service developer › Read server parameters and trace a run in the logs
    Execution modes › Activity log of a run and its children
    Scheduler developer › Prove a job ran with the log table
    Debugging & error handling › Where the logs go: trace, show, ids and retention
    System administrator & DevOps › Sessions and errors of the day
    System administrator & DevOps › Do the logs cover the metric window?
Often used with

    log archive size  ·  log archive path  ·  log current id  ·  log search  ·  log show  ·  log trace  ·  string regexp_extract  ·  date sysdate

log remove


Description

    To remove the logs older than the retention period

admin
log remove;
mentdb
1
Used in use cases (1 recipe)

    System administrator & DevOps › Maintenance window: lock, change the config, reopen
Often used with

    and  ·  config reload  ·  config set  ·  job scheduler restart  ·  kill  ·  log trace  ·  log write  ·  maintenance get

log archive size


Description

    To show the size of one archive file

admin
log archive size
mentdb
30
Used in use cases (5 recipes)

    Backend & web service developer › Read server parameters and trace a run in the logs
    Execution modes › Activity log of a run and its children
    Scheduler developer › Prove a job ran with the log table
    Debugging & error handling › Where the logs go: trace, show, ids and retention
    System administrator & DevOps › Sessions and errors of the day
Often used with

    log retention day  ·  log archive path  ·  log current id  ·  log search  ·  log show  ·  log trace  ·  date sysdate  ·  log write

log archive path


Description

    Get the path where archives are saved

admin
log archive path
mentdb
archives/logs
Used in use cases (4 recipes)

    Backend & web service developer › Read server parameters and trace a run in the logs
    Scheduler developer › Prove a job ran with the log table
    Debugging & error handling › Where the logs go: trace, show, ids and retention
    System administrator & DevOps › Sessions and errors of the day
Often used with

    log archive size  ·  log retention day  ·  log current id  ·  log search  ·  log show  ·  log trace  ·  date sysdate  ·  string regexp_count

log reset <code>


Description

    To reset the log system

Parameters

    code:   The code to reset all tables (18061980) - integer - not required
admin
log reset "xxx";
mentdb
1

log show_time <nodename> <pid>


Description

    To show the logs over time

Parameters

    nodename:   The node name - string - not required
    pid:   The process id - string - required
admin
log show_time 17
mentdb
{"column_types":["STRING","STRING","STRING","STRING","STRING","STRING","STRING","STRING","LONG"],"data":[{"msg":"[---- Begin script ----]","c_val":"","dtInsert":"2018-01-09 15:44:40","parent_pid":"","pid":"17","id":"887","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- End script ----]","c_val":"","dtInsert":"2018-01-09 15:44:40","parent_pid":"","pid":"17","id":"888","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- Begin script ----]","c_val":"","dtInsert":"2018-01-22 07:12:22","parent_pid":"","pid":"17","id":"1307","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- End script ----]","c_val":"","dtInsert":"2018-01-22 07:12:22","parent_pid":"","pid":"17","id":"1308","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- Begin script ----]","c_val":"","dtInsert":"2018-02-13 16:08:54","parent_pid":"","pid":"17","id":"2589","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- End script ----]","c_val":"","dtInsert":"2018-02-13 16:08:54","parent_pid":"","pid":"17","id":"2590","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- Begin script ----]","c_val":"","dtInsert":"2018-02-20 10:15:29","parent_pid":"","pid":"17","id":"2781","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- End script ----]","c_val":"","dtInsert":"2018-02-20 10:15:29","parent_pid":"","pid":"17","id":"2782","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- Begin script ----]","c_val":"","dtInsert":"2018-02-23 13:51:35","parent_pid":"","pid":"17","id":"3029","c_key":"","script":"boot.execute.on.start.post","status":"ok"},{"msg":"[---- End script ----]","c_val":"","dtInsert":"2018-02-23 13:51:35","parent_pid":"","pid":"17","id":"3030","c_key":"","script":"boot.execute.on.start.post","status":"ok"}],"columns":["dtInsert","status","script","parent_pid","pid","c_key","c_val","msg","id"],"title":"PID <17>"}
Used in use cases (2 recipes)

    Async developer › Push a script to the stack and watch it close
    Debugging & error handling › All the log lines of one process
Often used with

    log write  ·  script create  ·  script delete  ·  string substring  ·  and  ·  date now  ·  execute  ·  json parse_array

restricted show_pid <pid>


Description

    To show the logs of a process and of all its linked processes (same as log show_time)

Parameters

    pid:   The process id - string - required
admin
restricted show_pid 17;
mentdb
{"columns":["dtInsert","status","script","parent_pid","pid","c_key","c_val","msg","id"],"data":[...],"title":"PID <17>"}
Used in use cases (3 recipes)

    Execution modes › Activity log of a run and its children
    Async developer › A dispatcher pushes child runs and you follow the whole tree
    Debugging & error handling › All the log lines of one process
Often used with

    log write  ·  script create  ·  script delete  ·  execute  ·  string substring  ·  type is_integer  ·  and  ·  atom get