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

[Logs SDK] Log Appender for log4cxx

Open lalitb opened this issue 2 years ago • 4 comments

Log4cxx is one of the commonly used logging framework for C++, and it would be good to have the logging appender for the framework using logging bridge API.

More details:

Bridge API specs - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/bridge-api.md Bridge API implementation - https://github.com/open-telemetry/opentelemetry-cpp/tree/main/api/include/opentelemetry/logs Extending log4cxx - https://logging.apache.org/log4cxx/latest_stable/extending-log4cxx.html

The implementation should be part of the opentelemetry-cpp-contrib repo under the instrumentation directory.

lalitb avatar Mar 13 '23 16:03 lalitb

also maybe glog?

esigo avatar Mar 13 '23 19:03 esigo

Yes, actually I didn't find documentation for glog to write the data to appender/target. As an example for log4cxx - https://logging.apache.org/log4cxx/latest_stable/extending-log4cxx.html. But feel free to create a similar task for glog if it's possible.

lalitb avatar Mar 13 '23 19:03 lalitb

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

github-actions[bot] avatar May 15 '23 01:05 github-actions[bot]

Yes, actually I didn't find documentation for glog to write the data to appender/target. As an example for log4cxx - https://logging.apache.org/log4cxx/latest_stable/extending-log4cxx.html. But feel free to create a similar task for glog if it's possible.

Apparently, there is a LogSink class that can be used to redirect the logs somewhere else with the option to log to file at the same time. This is not very well documented but there are some unit tests showing the usage. I'm willing to give it a try and see what can be done with it.

chusitoo avatar Dec 28 '23 04:12 chusitoo

Closing, this is now implemented in opentelemetry-cpp-contribs.

marcalff avatar Mar 01 '24 11:03 marcalff