Logging integration design discussion
See original GitHub issue@c24t wish to know your thoughts as you’ve done the pilot work in #536.
- Currently the
use_oc_logging
works for all loggers created after the call. There is another way to work with loggers created before the call (although it could have wide impact, and only works for Py3.x), should we consider it (which seems to be useful for automatic capturing unhandled exceptions)?
class ContextLogRecord(logging.LogRecord):
def __init__(self, name, level, pathname, lineno, msg, args, exc_info, func=None, sinfo=None):
self.trace_id = 'foo'
self.span_id = 'bar'
return super(ContextLogRecord, self).__init__(name, level, pathname, lineno, msg, args, exc_info, func, sinfo)
logging.setLogRecordFactory(ContextLogRecord)
- Do we want to move
use_oc_logging
to an ext package and use config_integration?
config_integration.trace_integrations(['logging'])
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Some Thoughts On Logging & API design - AgileVision
I'll will not be arguing here whether it is good or bad because the topic of checked & unchecked exceptions deserves a lengthy...
Read more >System Design Logging Framework | Implementing Logger
In this video I have implemented a logging framework. Loggers are very common asked low level system design question.
Read more >5 best practices for designing application logs - CSO Online
Better logs make it easier to distinguish between critical data and noise. Here's how to design logs with security in mind.
Read more >Logging patterns from within library code
I am looking for a design pattern for logging from within library code. Suppose I have a function in a library file that...
Read more >Integration monitoring, logging and documentation using BIP
Would you like to discuss how your business could benefit from a modern, future-proof approach to information management? – Contact us at Enfo!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s also not clear why
BlankSpan
has a realspan_id
in the first place.This is happening today. When we receive an incoming request, we always store the span id in the context. So even if sampling flag is off, we can get the top level local span.
Run the following command against the following Flask app:
This is what we get: