census-instrumentation / opencensus-csharp

Distributed tracing and stats collecting framework
https://opencensus.io
Apache License 2.0
139 stars 32 forks source link

Error logging with EventSource #12

Closed lmolkova closed 5 years ago

lmolkova commented 6 years ago

We typically log all internal errors/warning/traces to EventSource in other .NET libs.

simonz130 commented 5 years ago

Do you have a sample on how you typically log with EventSource in .NET Core? Don't you have to define a schema first? Are you logging directly and not via this nuget? Microsoft.Extensions.Logging

lmolkova commented 5 years ago

Here is the sample: https://github.com/Microsoft/ApplicationInsights-dotnet/blob/10d2cacbdced85836c36e67f663a897efeb97359/src/Microsoft.ApplicationInsights/Extensibility/Implementation/Tracing/CoreEventSource.cs

documentation: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.tracing.eventsource?view=netcore-2.2.

Using EventSource does not require any additional dependencies (such as logging nuget). It also works out of process and is extremely lightweight. These events represent internal diagnostics of opencensus and in majority of cases are not interesting to users.

It does not actually have a schema, every event has a strict signature.

SergeyKanzhelev commented 5 years ago

Moved to OpenTelemetry