- README.md
- Pre-requisites
- Getting Started
- Advanced Configuration
- Setting Up Allocations
- Setting Up Cost Models
- Viewing Logs <- you are here
- Tips and Tricks
- Troubleshooting
First off, I strongly recommend having either graph-pino
or pino-pretty
installed for this.
You will need NPM installed for them to work and be viewable in a more human-esque manner.
sudo apt install npm -y
To install graph-pino
, you can simply do:
npm install -g --registry https://registry.npmjs.org/ @graphprotocol/graph-pino
To install pino-pretty
, you can simply do:
npm install -g pino-pretty
And you're done. These two will greatly help you read through the indexer-agent
and indexer-service
logs to easily find errors and warning messages that might occur.
docker logs indexer-agent --tail 10 -f | graph-pino
journalctl -fu indexer-agent -n 10 -f | graph-pino
docker logs indexer-agent --tail 10 -f | pino-pretty -c -t
journalctl -fu indexer-agent -n 10 -f | pino-pretty -c -t
❗ Note: pino-pretty and graph-pino only work for logs that output json strings (ie. indexer agent and service)
The following examples strip the colors out of pino-pretty, sends the stdout to /dev/null and print the logs into a file without showing you the logs on screen.
docker logs indexer-service 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &
journalctl CONTAINER_NAME=indexer-service -o cat 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &
If you want to extract specific dates from your logs you can do as follows, where -S
is the date/hour since, and -U
is the date/hour until.
journalctl CONTAINER_NAME=indexer-service -S "20:22:00" -U "20:55:00" -o cat 2>&1 | pino-pretty -c -t | sed -r "s/[[:cntrl:]]\[[0-9]{1,3}m//g" | tee service.log &> /dev/null &