Skip to content

Commit 0d8c909

Browse files
committed
more info around tracing
1 parent b2212f3 commit 0d8c909

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,25 @@ If you wish to see more logs, simply set the `LOG_LEVEL` to the desired level. H
2323
| NOTICE | Logs that track the general flow of the application. This is the default level | |
2424
| WARNING | Logs that highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop. | |
2525
| ERROR | Logs that highlight when the current flow of execution is stopped due to a failure. These should indicate a failure in the current activity, not an application-wide failure. | |
26-
| CRITICAL | Logs that describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention. | |
26+
| CRITICAL | Logs that describe an unrecoverable application or system crash, or a catastrophic failure that requires immediate attention. | |
27+
28+
29+
## Add traces to log
30+
31+
A great feature of Datadog is to correlate traces and logs to make troubleshooting easier.
32+
33+
To take advantage of this, you will need to:
34+
- install the `dd-trace` package
35+
- import it and init it with `logInjection:true`.
36+
- BuffLog will append automatically the traces to the logs (only within a request)
37+
38+
```js
39+
// make sure to put those lines at the very beginning of your service
40+
import tracer from "dd-trace";
41+
tracer.init({
42+
// will automatically append the traces to BuffLog
43+
logInjection: true
44+
45+
// ... all other options...
46+
});
47+
```

0 commit comments

Comments
 (0)