summaryrefslogtreecommitdiff
path: root/doc/api/tracing.md
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2018-01-31 17:12:09 +0100
committerAnatoli Papirovski <apapirovski@mac.com>2018-03-04 12:07:39 +0100
commit85212bb182f555f6d09e0b2f5f78d2d8e19bcef1 (patch)
tree182b8e0698057e8760462964c0deef66e6ccb34c /doc/api/tracing.md
parent523d44a66e5a4f9bbe335b7872919aa39d6ee4c4 (diff)
downloadnode-new-85212bb182f555f6d09e0b2f5f78d2d8e19bcef1.tar.gz
trace_events: add file pattern cli option
Allow the user to specify the filepath for the trace_events log file using a template string. PR-URL: https://github.com/nodejs/node/pull/18480 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc/api/tracing.md')
-rw-r--r--doc/api/tracing.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/api/tracing.md b/doc/api/tracing.md
index 3a534177a3..4e161faf9c 100644
--- a/doc/api/tracing.md
+++ b/doc/api/tracing.md
@@ -33,6 +33,15 @@ Running Node.js with tracing enabled will produce log files that can be opened
in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
tab of Chrome.
+The logging file is by default called `node_trace.${rotation}.log`, where
+`${rotation}` is an incrementing log-rotation id. The filepath pattern can
+be specified with `--trace-event-file-pattern` that accepts a template
+string that supports `${rotation}` and `${pid}`. For example:
+
+```txt
+node --trace-events-enabled --trace-event-file-pattern '${pid}-${rotation}.log' server.js
+```
+
Starting with Node 10.0.0, the tracing system uses the same time source as the
one used by `process.hrtime()` however the trace-event timestamps are expressed
in microseconds, unlike `process.hrtime()` which returns nanoseconds.