mongoc_structured_log_entry_message_as_bson

Synopsis

bson_t *
mongoc_structured_log_entry_message_as_bson (const mongoc_structured_log_entry_t *entry);

Make a new copy, as a bson_t <https://www.mongoc.org/libbson/current/bson_t.html>, of the log entry's standardized BSON representation. When possible, a log handler should avoid serializing log messages that will be discarded. Each call allocates an independent copy of the message that must be freed.

Parameters

Returns

A new allocated bson_t <https://www.mongoc.org/libbson/current/bson_t.html> that must be freed with a call to bson_destroy() <https://www.mongoc.org/libbson/current/bson_destroy.html>.

See also:

Structured Logging <>

Author

MongoDB, Inc

Info

Jan 27, 2026 1.30.6 libmongoc