---
name: "mongoc_structured_log_entry_message_as_bson"
section: "3"
platform: "linux"
package: "libmongoc-doc"
version: "1.30.4-1+deb13u3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mongoc_structured_log_entry_message_as_bson"
---

# mongoc\_structured\_log\_entry\_message\_as\_bson(3)

## 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*, 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

- •

  **entry**: A *mongoc\_structured\_log\_entry\_t* pointer.

## RETURNS

A new allocated *bson\_t* that must be freed with a call to *bson\_destroy()*.

**SEE ALSO:**

```
Structured Logging
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
