Skip to content

Commit 5e72762

Browse files
committed
docs(README): add info on debugging
1 parent 8b45723 commit 5e72762

1 file changed

Lines changed: 53 additions & 1 deletion

File tree

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
With version 3.x.x we have dropped support for Node v0.10. This means that
1616
future releases under this major version might contain code changes that are
1717
incompatible with Node.js v0.10 to an extent of crashing your application.
18-
Please consider updating to a newer runtime, especially that the
18+
Please consider updating to a newer runtime, especially that the
1919
[maintenance of v0.10 has already ended](node-lts). See our compatibility table
2020
below.
2121

@@ -167,6 +167,58 @@ Accepts a node-style callback to be called when trace stopped.
167167
Note: There is no way to restart trace after calling this method. You should end your process after calling this
168168
method.
169169

170+
## Troubleshooting
171+
172+
### Debug logs
173+
If you have problems using Trace, e.g it doesn't seem to report anything you can
174+
turn on logging. We use the lightweight
175+
(debug)[https://github.com/visionmedia/debug]. If you are not familiar with it
176+
yet, please read its documentation to learn how it works.
177+
178+
179+
#### Quickstart
180+
To turn it only for Trace start your app with the `DEBUG`
181+
environment variable set to `risingstack/trace*`.
182+
183+
```
184+
DEBUG=risingstack/trace* node my_app.js
185+
```
186+
187+
#### Configure logging
188+
189+
To make it possible to filter severities and components in Trace we use
190+
subnamespaces. The namespace will start with `trace/risingstack` then a `:` then
191+
a mandatory severity specifier,
192+
- `error`,
193+
- `warn` or
194+
- `info`.
195+
196+
Then come zero or more namespaces led by colons. The namespaces are
197+
hierarchically organized according to components inside of Trace.
198+
199+
Currently these namespaces (and their subnamespaces) are used:
200+
201+
- `config`
202+
- `instrumentation`
203+
- `agent`
204+
- `agent:tracer`
205+
- `agent:metrics`
206+
- `agent:profiler`
207+
- `agent:security`
208+
- `api`
209+
210+
As they can have subnamespaces, always append an `*` to them to get all
211+
messages.
212+
213+
Examples:
214+
215+
- get all error messages: `DEBUG=risingstack/trace:error*`
216+
217+
- get all messages from agents: `DEBUG=risingstack/trace:*:agent*`
218+
219+
- get all error messages and all messages from agents: `DEBUG=risingstack/trace:error*,risingstack/trace:*:agent*`
220+
221+
170222
## Compatibility with Node versions
171223

172224
* node v0.12@latest

0 commit comments

Comments
 (0)