# DAML JSON API - setting log encoder to JSON

**URL:** <https://forum.canton.network/t/daml-json-api-setting-log-encoder-to-json/3297>\
**Category:** App Development\
**Tags:** json-api\
**Created:** [October 12, 2021, 4:57am UTC](https://forum.canton.network/t/daml-json-api-setting-log-encoder-to-json/3297 "2021-10-12T04:57:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![huw](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/huw/32/2343_2.png) [@huw](https://forum.canton.network/u/huw)\
**Post date:** [October 12, 2021, 4:57am UTC](https://forum.canton.network/t/daml-json-api-setting-log-encoder-to-json/3297/1 "2021-10-12T04:57:20Z")

</div>

Hi, I see that you can run the JSON API with the following option:  
`--log-encoder json`

Does this mean the logs outputted to stdout should be formatted as JSON? When I use this option I can’t see any JSON in the logging output. What sort of output are we expecting here?

Here’s my full example, running this on Windows Server 2016, sdk version 1.14:

```haskell
P:\code\dlts-acceptance-test-suite>daml json-api --ledger-host localhost --ledger-port 6865 --allow-insecure-tokens --http-port 7575 --log-encoder json
15:47:11.271 INFO c.d.h.Main@[main] - Config(ledgerHost=localhost, ledgerPort=6865, address=127.0.0.1, httpPort=7575, portFile=None, packageReloadInterval=5 seconds, packageMaxIn
boundMessageSize=None, maxInboundMessageSize=4194304, tlsConfig=TlsConfiguration(false,None,None,None,REQUIRE,false,List()), jdbcConfig=None, staticContentConfig=None, allowNonHtt
ps=true, accessTokenFile=None, wsConfig=None, nonRepudiationCertificateFile=None, nonRepudiationPrivateKeyFile=None, nonRepudiationPrivateKeyAlgorithm=None)
15:47:11.677 INFO a.e.s.Slf4jLogger@[kka.actor.default-dispatcher-4] - Slf4jLogger started
15:47:11.943 INFO c.d.h.HttpService@[kka.actor.default-dispatcher-9] - HTTP Server pre-startup
15:47:12.271 INFO c.d.h.LedgerClient$@[kka.actor.default-dispatcher-9] - Attempting to connect to the ledger localhost:6865
 (attempt 1/600)
15:47:13.115 INFO c.d.h.LedgerClient$@[ka.actor.default-dispatcher-11] - Attempting to connect to the ledger localhost:6865
 (attempt 1/600)
15:47:13.115 INFO c.d.h.HttpService@[ka.actor.default-dispatcher-11] - Connected to Ledger: testledger
15:47:13.115 INFO c.d.h.HttpService@[ka.actor.default-dispatcher-11] - contractDao: None
15:47:13.896 INFO c.d.h.PackageService@[kka.actor.default-dispatcher-9] - new package IDs loaded: b453827ddcba88700f709dd3d69b394c47284ba1f2878bc540d4895f7745e183, bfcd37bd6b8476
8e86e432f5f6c33e25d9e7724a9d42e33875ff74f6348e733f, 518032f41fd0175461b35ae0c9691e08b4aea55e62915f8360af2cc7a1f2ba6c, cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da0596
1b7, 6839a6d3d430c569b2425e9391717b44ca324b88ba621d597778811b2d05031d, 99a2705ed38c1c26cbb8fe7acf36bbf626668e167a33335de932599219e0a235, 76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f876
2af490f8f41d6237c6524f, e22bce619ae24ca3b8e6519281cb5a33b64b3190cc763248b4c3f9ad5087a92c, d58cf9939847921b2aab78eaa7b427dc4c649d25e6bee3c749ace4c3f52f5c97, 6c2c0667393c5f92f188516
3068cd31800d2264eb088eb6fc740e11241b2bf06, c66ae614f0f7b122d9ac876d987fe9704c12151509b8dba3b821136c8eb33b1b, 8a7806365bbd98d88b4c13832ebfa305f6abaeaf32cfa2b7dd25c4fa489b79fb, c1f1
f00558799eec139fb4f4c76f95fb52fa1837a5dd29600baa1c8ed1bdccfd, 733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a, d14e08374fc7197d6a0de468c968ae8ba3aadbf9315476fd390
71831f5923662, 057eed1fd48c238491b8ea06b9b5bf85a5d4c9275dd3f6183e0e6b01730cc2ba, f8bea2edf79be4cb7ea245dea4953c27e12369bd30a3cf84e252421f52947bb7, e491352788e56ca4603acc411ffe1a49
fefd76ed8b163af86cf5ee5f4c38645b, 40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7, 97b883cd8a2b7f49f90d5d39c981cf6e110cf1f1c64427a28a6d58ec88c43657

```

---

<div class="post-metadata">

**Author:** ![huw](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/huw/32/2343_2.png) [@huw](https://forum.canton.network/u/huw)\
**Post date:** [October 12, 2021, 5:02am UTC](https://forum.canton.network/t/daml-json-api-setting-log-encoder-to-json/3297/2 "2021-10-12T05:02:54Z")

</div>

Sorry please ignore this question, I see this is fixed in sdk 1.15.0

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [October 12, 2021, 6:04am UTC](https://forum.canton.network/t/daml-json-api-setting-log-encoder-to-json/3297/3 "2021-10-12T06:04:43Z")

</div>

For SDK 1.14 I believe the standalone JAR also works. It’s only broken when run via the assistant.
