Skip to content

Commit

Permalink
add documentation to view docker logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanakram3 committed Feb 22, 2024
1 parent d3ce6c1 commit dc5f2c1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,22 @@ The Joystream Storage-Squid is a [Subsquid](https://docs.subsquid.io/) based pro
make prepare # install dependencies and build the project
make up-squid # start the storage-squid processor and the GraphQL server
```

## Logging

The storage-squid uses the `@subsquid/logger` package for logging. The logger is configured to log to `stderr` and the log level is determined by the `SQD_*` environment variables.

By default, the log level for Storage Squid processor is set to `SQD_DEBUG=sqd:processor:mapping`. This means that all loggers will log at `DEBUG` level. So the processor logs will contain `DEBUG`, `INFO`, `WARN`, `ERROR` and `FATAL` logs (The integer values for these logging levels are `1`, `2`, `3`, `4` and `5` respectively).

However, sometimes it is very difficult to analyze the processor logs because of the high volume of DEBUG logs. So maybe you only want to see `INFO`, `WARN`, `ERROR` and `FATAL` logs. You can do this by using the `docker logs ...` command in the following way

```bash
# Only INFO logs
docker logs squid_processor 2>&1 | grep -E "\"level\":2"

# INFO and above logs
docker logs squid_processor -f 2>&1 | grep -E "\"level\":2|\"level\":3|\"level\":4|\"level\":5"

# You can also use other docker logs options like --follow, --tail etc
docker logs squid_processor --follow --tail 100 2>&1 | grep -E "\"level\":2|\"level\":3|\"level\":4|\"level\":5"
```

0 comments on commit dc5f2c1

Please sign in to comment.