userver-framework / userver

Production-ready C++ Asynchronous Framework with rich functionality
https://userver.tech
Apache License 2.0
2.37k stars 275 forks source link

JSON logging format #180

Open apolukhin opened 1 year ago

apolukhin commented 1 year ago

At the moment 'tskv' and 'ltsv' logging formats are supported https://github.com/userver-framework/userver/blob/f04f77329c105bfbfb3b3f70b25b531dc53f07b9/core/include/userver/logging/format.hpp#L13

JSON format is a popualr logging format, it should be supported too.

TertiumOrganum1 commented 5 months ago

voting for json, but also it would be nice to have a simple format for local output, ideally - to select fields for output. for example, timestamp and msg only

TertiumOrganum1 commented 4 months ago

It would be nice to have out if the box 'otlp json' format option for logger 'opentracing' (should be also renamed to 'opentelemetry' or 'otel', as opentracing standard is archived since 2022). Protobuf schema described here: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.3.0/opentelemetry/proto/trace/v1/trace.proto Json mapping looks like: https://www.honeycomb.io/blog/test-span-opentelemetry-collector

apolukhin commented 4 months ago

Thanks to all the contributors, we now have an understanding of how such logging should look like. Will adopt the functionality and features soon