Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2018-01-31 19:12:09 +0300
committerAnatoli Papirovski <apapirovski@mac.com>2018-03-04 14:07:39 +0300
commit85212bb182f555f6d09e0b2f5f78d2d8e19bcef1 (patch)
tree182b8e0698057e8760462964c0deef66e6ccb34c /doc/api/tracing.md
parent523d44a66e5a4f9bbe335b7872919aa39d6ee4c4 (diff)
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 3a534177a37..4e161faf9cd 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.