MENU

How to turn on logging in SubQuery?

May 31, 2021
0
1810
0

In SubQuery, you can log messages on 3 different levels. They are:

logger.info("info")
logger.debug("debug")
logger.warn("warning")

For example, adding “logger.info(“info test”)

results in:

The same can be done with warnings. However, to add a debug log, an extra modification needs to be made. The docker-compose.yaml file needs to have an additional –log-level=debug command passed to it.

command:
      - --log-level=debug

Here is a screenshot of the docker-compose.yaml file from the Hello World starter project.

Also don’t forget to regenerate and build the code first via:

yarn codegen
yarn build

and then running:

docker-compose up

Leave a Comment!

Your email address will not be published. Required fields are marked *