question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Properly use LoggingContext in Participant Server

See original GitHub issue

There are quite a few classes where we pass the LoggingContext to the constructor, instead of the individual methods. This means that the log lines of the methods will use the logging context that was used during initialization. The result is that call-specific information (e.g. party, beginOffset, endOffset, …) are not actually logged.

Basically, the logging context needs to be passed along the chain from where the request is received to where the data for the request is fetched.

Example chain: ApiTransactionService#getTransactions -> IndexTransactionService#transactions (impl: LedgerBackedIndexService) -> ReadOnlyLedger#flatTransactions (impl: BaseLedger) -> TransactionsReader#getFlatTransactions

Examples of where the wrong logging context (from the class’ constructor) is being used:

This pattern is quite pervasive throughout the code base and requires adding an implicit logging context to the methods of internal interfaces (e.g. Index*Service, LedgerDao, Ledger, …)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
gerolf-dacommented, Jul 23, 2020

Sorry, I didn’t try to argue “against” you, but simply that either we use the approach properly, or just don’t bother with it. It’s the middle ground that doesn’t provide much benefit. 👍

0reactions
stefanobaghino-dacommented, Jul 29, 2020

Note that passing down the logging context to services via constructors is helpful: the logging context created when instantiating the service handler contains (at the very least) the participant identifier. Instead of creating a brand new logging context this information can be enriched by individual endpoints.

Read more comments on GitHub >

github_iconTop Results From Across the Web

12. Release Notes — RTI Routing Service 6.0.0 documentation
12.3.8. Support for advanced logging¶. Routing Service internal logging has improved to provide more detailed logging context. With advanced logging, all the ...
Read more >
Studying the Use of Java Logging Utilities in the Wild
ABSTRACT. Software logging is widely used in practice. Logs have been used for a variety of purposes like debugging, monitoring, ...
Read more >
Network Server Fault and Alarm Interface Specification - DevNet
The Cisco BroadWorks SNMP interface is configured using the CLI client ... The file server is properly configured in CLI context System/.
Read more >
Release of Daml Connect 1.16.0 - Digital Asset Blog
Daml Studio, Sandbox and ledgers now emit a warning when using a divulged contract in a way that is incompatible with participant pruning....
Read more >
Resource API reference - Puppet
Use this information to understand how the Resource API works: how the ... absent] attribute pattern must react correctly on a missing :should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found