This demo shows one C++ process loading a Rust shared library and sending OTLP
logs into ljd over gRPC.
The path is:
C++ appliance -> liblogjet.so -> OTLP/gRPC -> ljd -> .logjet file -> ljx view
From the project root:
cargo build -p ljd -p ljx -p liblogjetYou also need g++ available locally because the demo compiles the C++
example on demand.
From this directory:
./run-demo.shThe script:
- builds the example C++ logger
- starts file-backed
ljdon127.0.0.1:4317 - loads
liblogjet.sothroughdlopen - sends 25 OTLP log records from C++ by default
- opens
ljx viewon the resulting./logs/cpp-demo.logjet
- the library now supports both OTLP/HTTP and OTLP/gRPC constructors
- this demo specifically uses OTLP/gRPC
- the FFI API is intentionally small: endpoint, service name, timestamp, severity, message body, and string attributes
- those key/value pairs become OTLP
LogRecord.attributes, which is the standard OTel metadata field for log records - if the appliance already has JSON metadata, the better long-term shape is to flatten that JSON into separate attributes where possible; a raw JSON blob can still be sent as one string attribute when needed
- the demo uses a local symlink named
liblogjet.sothat points at Cargo's built shared object