opentelemetry-cpp/examples/logs_simple
Doug Barker 549f2b009d
[TEST] test examples in CI with CMake Part 1 (#3449)
2025-06-05 20:49:45 +02:00
..
BUILD Add example for Logs ostream exporter (#1992) 2023-02-19 22:17:08 -08:00
CMakeLists.txt [TEST] test examples in CI with CMake Part 1 (#3449) 2025-06-05 20:49:45 +02:00
README.md [EXAMPLES] Use logs API instead of logs bridge API in the example (#2494) 2024-01-18 22:52:12 +01:00
main.cc [SDK] Support OTEL_SDK_DISABLED environment variable (#3245) 2025-02-05 21:42:51 +01:00

README.md

Simple Logs Example

In this example, the application in main.cc initializes an OStreamLogRecordExporter instance and registers a logger provider, as well as initializes a StdoutSpanExporter instance and registers a tracer provider from the OpenTelemetry C++ SDK.

The application then calls into logs_foo_library which has been instrumented using the OpenTelemetry Logs API. Resulting logs and traces are directed to stdout.

See CONTRIBUTING.md for instructions on building and running the example.