|
| 1 | +# Logging |
| 2 | + |
| 3 | +Logs are created via the `tracing` crates. We define various _scopes_ depending on the operation we want to trace at various debug levels. The log level can be set via the `RUST_LOG` environment variable, and via the `/tracing-level` at runtime by the node operator. |
| 4 | + |
| 5 | +For each request we track various information depending on the error log lvel: |
| 6 | +- **Incoming**: |
| 7 | + - `ERROR`: |
| 8 | + - `request.id`: a randomly generated uuid for that specific request |
| 9 | + - `prepare.destination`: the destination of the prepare packet inside the request |
| 10 | + - `prepare.amount`: the amount in the prepare packet inside the request |
| 11 | + - `from.id`: the request sender's account uuid |
| 12 | + - `DEBUG`: |
| 13 | + - `from.username`: the request sender's username |
| 14 | + - `from.ilp_address`: the request sender's ilp address |
| 15 | + - `from.asset_code`: the request sender's asset code |
| 16 | + - `from.asset_scale`: the request sender's asset scale |
| 17 | +- **Forwarding** (this is shown when an incoming request is turned into an outgoing request and is being forwarded to a peer): |
| 18 | + - `ERROR`: |
| 19 | + - `prepare.amount`: the amount in the prepare packet inside the request |
| 20 | + - `from.id`: the request sender's account uuid |
| 21 | + - `DEBUG`: |
| 22 | + - `to.username`: the request receiver's username |
| 23 | + - `to.ilp_address`: the request receiver's ilp address |
| 24 | + - `to.asset_code`: the request receiver's asset code |
| 25 | + - `to.asset_scale`: the request receiver's asset scale |
| 26 | +- **Outgoing**: |
| 27 | + - `ERROR`: |
| 28 | + - `request.id`: a randomly generated uuid for that specific request |
| 29 | + - `prepare.destination`: the destination of the prepare packet inside the request |
| 30 | + - `from.id`: the request sender's account uuid |
| 31 | + - `to.id`: the request receiver's account uuid |
| 32 | + - `DEBUG`: |
| 33 | + - `from.username`: the request sender's username |
| 34 | + - `from.ilp_address`: the request sender's ilp address |
| 35 | + - `from.asset_code`: the request sender's asset code |
| 36 | + - `from.asset_scale`: the request sender's asset scale |
| 37 | + - `to.username`: the request receiver's username |
| 38 | + - `to.ilp_address`: the request receiver's ilp address |
| 39 | + - `to.asset_code`: the request receiver's asset code |
| 40 | + - `to.asset_scale`: the request receiver's asset scale |
| 41 | + |
| 42 | +Then, depending on the response received for the request, we add additional information to that log: |
| 43 | +- `Fulfill`: We add a scope `"result = fulfill"` at the `DEBUG` level |
| 44 | + - `fulfillment`: the fulfill packet's fulfillment condition |
| 45 | +- `Reject`: We add a scope `"result = "reject"` at the INFO level |
| 46 | + - `reject.code`: the reject packet's error code field |
| 47 | + - `reject.message`: the reject packet's message field |
| 48 | + - `reject.triggered_by`: the reject packet's triggered_by field |
0 commit comments