Getting debug outputs from trigger service

It looks like the default logback file for the trigger service does not enable those logs. However, you can change the logback config just like you would for sandbox (described in How can I make debug statements visible in the sandbox logs? - #2 by cocreature).

Specifically, create a logback based on the default trigger service logback config (you can find that at ~/.daml/sdk/1.18.0/daml-sdk/trigger-service-logback.xml that enables daml.traceLog:

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>

    <logger name="io.netty" level="WARN">
        <appender-ref ref="stderr-appender"/>
    <logger name="io.grpc.netty" level="WARN">
        <appender-ref ref="stderr-appender"/>
    <logger name="daml.tracelog" level="DEBUG" />
    <root level="INFO">
        <appender-ref ref="STDOUT" />

Then start the trigger service with that logback config:

_JAVA_OPTIONS=-Dlogback.configurationFile=/PATH/TO/YOUR/logback.xml daml trigger-service --ledger-host localhost --ledger-port 6865 --dar .daml/dist/foobar-0.0.1.dar

That will emit the tracelog statements. Unfortunately, you cannot see which trigger produced them. I opened Add logging context to daml tracelog stateemnts · Issue #12208 · digital-asset/daml · GitHub to fix that. In the meantime you’ll have to include some context yourself to figure that out.

1 Like