# How to make debug statements visible in the Canton Sandbox logs

**URL:** <https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556>\
**Category:** App Development\
**Created:** [May 15, 2023, 10:45pm UTC](https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556 "2023-05-15T22:45:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![WallaceKelly](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/wallacekelly/32/5046_2.png) [@WallaceKelly](https://forum.canton.network/u/WallaceKelly)\
**Post date:** [May 15, 2023, 10:45pm UTC](https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556/1 "2023-05-15T22:45:45Z")

</div>

Three years ago, to [make debug statements visible in the sandbox logs](https://discuss.daml.com/t/how-can-i-make-debug-statements-visible-in-the-sandbox-logs/478/2), @cocreature suggested the following:

> …write a custom logback configuration file  
> You can find the default logback config used by `daml sandbox` at  
> `$HOME/.daml/sdk/$YOUR_SDK_VERSION/daml-sdk/sandbox-logback.xml` .

Today’s Canton-based Daml SDK does not have a `sandbox-logback.xml` file.

Two questions:

1. Where can I find the equivalent in the Daml SDK 2.6? Is [this logback.xml](https://github.com/digital-asset/canton/blob/54f6c45c32450b1843b72f3706a23c3e89255cf0/community/app/src/main/resources/logback.xml) the one I’m looking for?

2. What do I need to add to the logback file to include the output of `debug` statements in the log file?

---

<div class="post-metadata">

**Author:** ![Ratko\_Veprek](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ratko_veprek/32/206_2.png) [@Ratko\_Veprek](https://forum.canton.network/u/Ratko_Veprek)\
**Post date:** [May 16, 2023, 3:01pm UTC](https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556/2 "2023-05-16T15:01:10Z")

</div>

The `daml sandbox` command is a very thin wrapper around the canton application. If you need to debug, I’d recommend to run canton directly:

[https://docs.daml.com/canton/tutorials/getting\_started.html](https://docs.daml.com/canton/tutorials/getting_started.html)

For debugging, you might find these two guides helpful:

[https://docs.daml.com/canton/usermanual/monitoring.html#logging](https://docs.daml.com/canton/usermanual/monitoring.html#logging)

[https://docs.daml.com/canton/usermanual/troubleshooting\_guide.html](https://docs.daml.com/canton/usermanual/troubleshooting_guide.html)

---

<div class="post-metadata">

**Author:** ![WallaceKelly](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/wallacekelly/32/5046_2.png) [@WallaceKelly](https://forum.canton.network/u/WallaceKelly)\
**Post date:** [May 16, 2023, 8:49pm UTC](https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556/3 "2023-05-16T20:49:30Z")

</div>

For large models and in-depth debugging, I’m sure you are right, @Ratko_Veprek – run canton directly.

I was still curious, for the use case of simple tutorials and demos, how to get visibility to `debug` output when using `daml start` and Navigator. I learned more about Logback than I wanted. Here is what I found works:

1. Copy the Canton logback.xml file into your project root.  
`jar xf ~/.daml/sdk/<SDK VERSION>/canton/canton.jar logback.xml`

2. Add the following to the logback.xml before the closing `</configuration>`:

3. `export _JAVA_OPTIONS="-Dlogback.configurationFile=./logback.xml"`

4. `LOG_DAML_TRACELOG=1 daml start`

I now see the output of my `debug` statements in a `log/trace.log` file.

If this looks good to others, we could add it to the default logback.xml file.

_Actually, I get duplicate entries in my `log/trace.log` file. As best I can tell, that is not related to my logback.xml edits. So I’ll leave that for another question._

---

<div class="post-metadata">

**Author:** ![David\_Martins](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/david_martins/32/1792_2.png) [@David\_Martins](https://forum.canton.network/u/David_Martins)\
**Post date:** [July 12, 2023, 11:00am UTC](https://forum.canton.network/t/how-to-make-debug-statements-visible-in-the-canton-sandbox-logs/6556/4 "2023-07-12T11:00:09Z")

</div>

To further extend on this topic, is it possible to define a new logback file in ledger run time? Or any way to change log level while ledger is still running?
