Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0805068

Browse filesBrowse files
thedulldanielleadams
authored andcommitted
doc: add note for handling signal events in trace events
Refs: #14802 PR-URL: #41438 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Adrian Estrada <edsadr@gmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 77cb604 commit 0805068
Copy full SHA for 0805068

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/tracing.md‎

Copy file name to clipboardExpand all lines: doc/api/tracing.md
+11Lines changed: 11 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ string that supports `${rotation}` and `${pid}`:
8080
node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js
8181
```
8282

83+
To guarantee that the log file is properly generated after signal events like
84+
`SIGINT`, `SIGTERM`, or `SIGBREAK`, make sure to have the appropriate handlers
85+
in your code, such as:
86+
87+
```js
88+
process.on('SIGINT', function onSigint() {
89+
console.info('Received SIGINT.');
90+
process.exit(130); // Or applicable exit code depending on OS and signal
91+
});
92+
```
93+
8394
The tracing system uses the same time source
8495
as the one used by `process.hrtime()`.
8596
However the trace-event timestamps are expressed in microseconds,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.