# Json-api debug messages

**URL:** <https://forum.canton.network/t/json-api-debug-messages/5209>\
**Category:** App Development\
**Tags:** debug\
**Created:** [September 11, 2022, 2:53pm UTC](https://forum.canton.network/t/json-api-debug-messages/5209 "2022-09-11T14:53:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorShneer](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/victorshneer/32/5413_2.png) [@VictorShneer](https://forum.canton.network/u/VictorShneer)\
**Post date:** [September 11, 2022, 2:53pm UTC](https://forum.canton.network/t/json-api-debug-messages/5209/1 "2022-09-11T14:53:16Z")

</div>

Hi daml Community!

I run sandbox with:

`daml sandbox --port-file ./scripts/components/canton-sandbox-port.txt --log-level-root=DEBUG --log-level-canton=DEBUG --log-level-stdout=DEBUG`

and then json-api with:

`daml json-api --ledger-host localhost --ledger-port 6865 --http-port 7575 --log-level DEBUG --max-inbound-message-size 9283730`

Then I exercise a choice via json-api. Inside daml choice code I have

`debug "my message"`

Is there a way to print debug messages to the log? With this set up I cannot find my debug messages… Am I missing something? Is it possible? I want to debug a choice exercising it from json-api. I see debug messages with VS Code sandbox running a script but not with json-api request… I tried trace messages and cannot find them in the log too.

---

<div class="post-metadata">

**Author:** ![Mate\_Varga](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/mate_varga/32/2308_2.png) [@Mate\_Varga](https://forum.canton.network/u/Mate_Varga)\
**Post date:** [September 12, 2022, 8:42am UTC](https://forum.canton.network/t/json-api-debug-messages/5209/2 "2022-09-12T08:42:16Z")

</div>

Hi @VictorShneer,

I used the same arguments as you did and my debug message showed up for me upon exercising the choice. You should check your sandbox logs (log/canton.log at the path you started the sandbox at by default).  
Search for “DEBUG daml.tracelog”, the result should be only lines outputted by your code.

Kind Regards,  
Mate

---

<div class="post-metadata">

**Author:** ![Stephen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/stephen/32/102_2.png) [@Stephen](https://forum.canton.network/u/Stephen)\
**Post date:** [September 12, 2022, 3:44pm UTC](https://forum.canton.network/t/json-api-debug-messages/5209/3 "2022-09-12T15:44:42Z")

</div>

> [@VictorShneer](#):
>
> –log-level DEBUG

For what it’s worth, this option doesn’t help here. As @Mate_Varga noted, the log appears in the sandbox log; it will never appear in json-api’s own logs, because json-api is not executing the daml containing the `debug` call, and never sees this message.
