Skip to content

Commit

Permalink
doc: add note for handling signal events in trace events
Browse files Browse the repository at this point in the history
Refs: #14802
  • Loading branch information
thedull committed Jan 18, 2022
1 parent 56679eb commit 99f3758
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/api/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ string that supports `${rotation}` and `${pid}`:
node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
```

To guarantee that the log file is properly generated after signal events like
`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
in your code, such as:

```js
process.on('SIGINT', function onSigint() {
console.info('Received SIGINT.');
process.exit();
});
```

The tracing system uses the same time source
as the one used by `process.hrtime()`.
However the trace-event timestamps are expressed in microseconds,
Expand Down

0 comments on commit 99f3758

Please sign in to comment.