Json-api debug messages

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.

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

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.

1 Like