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

**URL:** <https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [April 27, 2021, 1:42pm UTC](https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523 "2021-04-27T13:42:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lashenhurst](https://avatars.discourse-cdn.com/v4/letter/l/71e660/32.png) [@lashenhurst](https://forum.canton.network/u/lashenhurst)\
**Post date:** [April 27, 2021, 1:42pm UTC](https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523/1 "2021-04-27T13:42:22Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [April 27, 2021, 2:39pm UTC](https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523/2 "2021-04-27T14:39:55Z")

</div>

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:

```haskell
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

```haskell
nc -z $LEDGER_HOST $LEDGER_PORT

```

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

---

<div class="post-metadata">

**Author:** ![bartcant](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/bartcant/32/823_2.png) [@bartcant](https://forum.canton.network/u/bartcant)\
**Post date:** [March 18, 2022, 3:48pm UTC](https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523/3 "2022-03-18T15:48:11Z")

</div>

@Gary_Verhaegen what would be the pattern in the json-api-logback.xml to display the actual json-api message.

default pattern is coded as below

```haskell
> <configuration>
> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
> <!-- encoders are assigned the type
> ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
> <encoder>
> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
> </encoder>
> </appender>
> <logger name="io.netty" level="WARN" />
> <logger name="io.grpc.netty" level="WARN" />
> <logger name="ch.qos.logback" level="WARN" />
> <root level="INFO">
> <appender-ref ref="STDOUT" />
> </root>
> </configuration>

```

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [March 18, 2022, 3:59pm UTC](https://forum.canton.network/t/is-it-possible-to-change-the-log-level-for-the-json-api-jar/2523/4 "2022-03-18T15:59:30Z")

</div>

Hi @bartcant,

I know the option to override the logback config _exists_, but that’s honestly the limit of my knowledge on the topic.

You _may_ have more luck opening a new topic asking specifically for the format and options of that XML file, but as I mentioned last year I do not think this is in any way supported.
