Skip to content

[Logs] How do I get a simplified logger result? #1747

Answered by lalitb
MateuszMiekicki asked this question in Q&A
Discussion options

You must be logged in to vote

I would like to keep the fields from the "complex" logger, but at the same time I need the file name and the line.

These fields are coming from the logs data model. If you want to add file-name/line-number, you can pass them using attributes field. We may plan to create convenience macros on top of the existing API to implicitly add these fields, but at the moment Logging API/SDK is still experimental, and work in progress - https://github.com/open-telemetry/opentelemetry-cpp/milestone/18, and not recommended for production use.

I also found a LogHandler, but it doesn't match the result of the LoggerProvider.

These are two different things - LogHandler is part of opentelemetry-cpp int…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@MateuszMiekicki
Comment options

@lalitb
Comment options

@MateuszMiekicki
Comment options

Answer selected by MateuszMiekicki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1746 on November 08, 2022 00:37.