From 85212bb182f555f6d09e0b2f5f78d2d8e19bcef1 Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Wed, 31 Jan 2018 17:12:09 +0100 Subject: 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 Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/tracing.md | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'doc/api/tracing.md') 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. -- cgit v1.2.1