Is it possible to change the log level for the JSON API jar?

Hi all!

I noticed, when playing with the jar files included in the 1.11.1 release that the daml-on-sql jar provides an argument to set the log level, but the http json api does not provide this argument.

Currently we are running in to issues where the http json api jar is unable to reach the daml-on-sql jar to make that initial connection, but because we cannot change the log level of the http json api jar we cannot get any more information (i.e. about why this connection cannot be made), only the fact that it could not be made.

Is there a way around this issue, or will setting the log level be added to the http json api?

Thank you!

1 Like

Hi @lashenhurst,

My first guess would be that they are running on different machines (/Docker containers) and you forgot to pass the --address flag to the daml-on-sql jar to tell it not to bind on 127.0.0.1 (localhost).

Regarding logs, I don’t think this is is any way supported, but you can configure very fine-grained logging behaviour by passing in a logback config using the logback.configurationFile Java property, as in:

java -Dlogback.configurationFile=/path/to/logback.xml -jar ...

You can use the one in $DAML_HOME/sdk/$VERSION/daml-sdk/json-api-logback.xml as a starting point.

I don’t know if there are logs that would help you though; honestly for connection issues I’d recommend debugging them with netcat first: if

nc -z $LEDGER_HOST $LEDGER_PORT

does not exit with 0, there’s nothing you can do at the JSON API level.

1 Like