Json-api: What should the "reading token" log message every five seconds tell me?

Good afternoon all,

When running the json-api from the command line, I get the below log message every five seconds:

[http-json-ledger-api-akka.actor.default-dispatcher-10] INFO com.daml.auth.TokenHolder - Reading token from .\path\to\token.txt...

There doesn’t seem to be any actual error with the token, and the json api seems to be responding to requests as expected, but these constant messages that aren’t really providing meaningful information are making it difficult to see log messages as part of processing a request.

Does this message mean I made a mistake in my config? Or is it just a status message? Or something in between?

1 Like

The JSON API periodically reloads the token to handle the case where it expires and you’ve updated it. The log message doesn’t indicate any error, it just means that it is reading the token again so it’s merely a status message.

2 Likes

Thank you!

1 Like

You can also suppress certain log messages entirely as @cocreature detailed in the post below where he talks about how to do that with sandbox, but it can be done with any command, such as json-api:

java -Dlogback.configurationFile=./your-custom-logback.xml -jar ~/.daml/sdk/1.9.0/daml-sdk/daml-sdk.jar json-api --your-json-api-options

Snippet below but make sure to read the full post.

1 Like