INFO logging

We are trying to trace some latency in our application while running on DAML hub and its logging is only set to INFO level and I can’t figure out how to add a INFO logging statement. I see DEBUG and TRACE in the Prelude.daml file but nothing that jumps out that it would log at the INFO level. How would I accomplish that? Thanks!

Hi @RyanMedlen

Have you tried passing the log message to the logger via an info() method?
For e.g logger.info(msg)

For reference you can find the default logback config used by daml navigator at $HOME/.daml/sdk/$YOUR_SDK_VERSION/daml-sdk/navigator-logback.xml

If you want to use a custom logback.xml then have a look at this thread

Thanks.

Hi @RyanMedlen ,

You can track a command at INFO level already. Look for lines like this, which are at the beginning:

2023-07-16 10:03:50,321 [canton-env-execution-context-171] INFO  c.d.p.a.s.ApiSubmissionService - Submitting commands for interpretation, context: {participant: "participant", tid: "", commands: {readAs: [], deduplicationPeriod: {duration: "PT168H"}, submittedAt: "2023-07-16T00:03:50.321282Z", ledgerId: "participant", applicationId: "MYAPP", submissionId: "bd2e21e4-1f18-11ee-be56-0242ac120002", actAs: ["Alice::abc123"], commandId: "c9cbe4ea-1f18-11ee-be56-0242ac120002", workflowId: "cf6c958e-1f18-11ee-be56-0242ac120002"}}

And you can see the participant finalizing the accepted transaction here:

2023-07-16 10:03:51,863 [input-mapping-pool-2] INFO  c.d.p.i.p.ParallelIndexerSubscription - Storing Accept transaction abc123, context: {participant: "participant", offset: "0000000000000001fb", update: {submissionTime: "2023-07-16T00:03:50.321280Z", recordTime: "2023-07-16T00:03:47.189838Z", completion: {actAs : ["Alice::abc123"], commandId : "c9cbe4ea-1f18-11ee-be56-0242ac120002", submissionId: "bd2e21e4-1f18-11ee-be56-0242ac120002", deduplicationPeriod : {offset: "000000000000000001"}, applicationId : "MYAPP"}, workflowId: "cf6c958e-1f18-11ee-be56-0242ac120002", transactionId: "abc123", ledgerTime: "2023-07-16T00:03:50.321280Z"}}

So as long as you know the commandId or submissionId you can find the command and its latency.

We have no issue doing it in sandbox/navigator as we control the log level. This is with testing on DAML Hub where we don’t have access to change the log level and it is set at INFO.

Each request kicks off abunch of different things on the DAML side so the goal was to break it down into pieces that are easily searchable by a value to see where the time was being taken. This was on the recommendation of our CX resource at DA.