opentelemetry-cpp icon indicating copy to clipboard operation
opentelemetry-cpp copied to clipboard

Are there docs/examples for the logging functionality?

Open Falmarri opened this issue 2 years ago • 5 comments

The last release marks logging as public. But I don't see any docs about this. Is this intended to be a general purpose logging framework? I'm currently using spdlog, but I have structure hacked into it. If this project also is intending to support native structured logging, I'm very interested. But I'm hesitant given there seems to be 0 documentation.

Falmarri avatar Sep 08 '23 19:09 Falmarri

This is missing, and part of the plan ...

  • #1695

marcalff avatar Sep 11 '23 20:09 marcalff

@Falmarri , our API docs are still under progress. Our API is intended for general purpose logging, but currently we only support OpenTelemetry backend (SDK&exporter). Wondering which logging scenario you are interested in.

ThomsonTan avatar Sep 25 '23 20:09 ThomsonTan

This issue was marked as stale due to lack of activity.

github-actions[bot] avatar Nov 25 '23 01:11 github-actions[bot]

@ThomsonTan Basically structured logging to files, with arbitrary key/value pairs. Specifically we log in ECS format. But also the ability to use arbitrary key values. I currently hack this using spdlog and some custom json. Ideally it would work somewhat similar to python logs (with the knowledge that python is much more flexible here), such that some form/version of

logger.info("Some message", key="value", **{"event.duration": 1000})

would result in

{"@timestamp": ..., "log": {"level": "info", "logger": "whatever"}, "message": {"Some message"}, "event": {"duration": 1000}, "key": "value"}

Or some similar syntax.

Basically, just files and/or stdout. We have a lot of logging framework built to eventually get ingested by our ELK stack.

Falmarri avatar Nov 26 '23 07:11 Falmarri

This issue was marked as stale due to lack of activity.

github-actions[bot] avatar Jan 28 '24 01:01 github-actions[bot]