Summary
Logs are the most flexible telemetry signal – they can be used to write information in human-readable format, complement traces with more information, or record structured events to analyze usage or performance.
To write logs, we can use different logging APIs – ILogger
works best for application code, while EventSource
is usually the best choice for libraries.
ILogger
makes it easy to write structured logs efficiently, but it depends on application authors to do so by minimizing log volume and the operations needed to calculate logging arguments.
ILogger
has a rich ecosystem of integrations with .NET frameworks, libraries, and providers that can send logs almost anywhere in a flat or structured format.
Collecting and exporting ILogger
logs with OpenTelemetry produces logs that are consistent and correlated with other telemetry signals.
In addition to application logs, we usually also need to collect logs from infrastructure or legacy systems. We...