MONGOC_STRUCTU...OCUMENT_LENGTH(3)

πŸ’… MONGOC_STRUCTU...OCUMENT_LENGTH(3) πŸ’…

okay so bestie, welcome to the libmongoc manual page for mongoc_structured_log_opts_set_max_document_length() β€” yes, that name is a whole mouthful, but it’s literally the β€œplease don’t let my serialized JSON get huge” knob. πŸ’–

✨ SYNOPSIS ✨

bool
mongoc_structured_log_opts_set_max_document_length (mongoc_structured_log_opts_t *opts,
                                                    size_t max_document_length);

πŸ’– DESCRIPTION πŸ’–

This function sets a maximum length for BSON documents that appear serialized in JSON form as part of a structured log message.

Serialized JSON gets truncated at this limit, and the limit is interpreted as a count of UTF-8 encoded bytes. Truncation is indicated with a ... suffix, and the length of that suffix is not included in the max document length. If truncation at the exact indicated length would split a valid UTF-8 sequence, the document gets truncated earlier instead β€” at the nearest boundary between code points. iykyk, no partial characters allowed. 🧚

πŸŽ€ PARAMETERS πŸŽ€

  • opts β€” structured log options, allocated with mongoc_structured_log_opts_new().
  • max_document_length β€” maximum length for each embedded JSON document, in bytes, not including an ellipsis (...) added to indicate truncation. Values near or above INT_MAX will be rejected. 🫢

πŸ¦‹ RETURNS πŸ¦‹

Returns true on success, or false if the supplied maximum length is too large.

πŸ”₯ SEE ALSO πŸ”₯

  • Structured Logging
  • mongoc_structured_log_opts_set_max_document_length_from_env()

πŸ‘‘ AUTHOR πŸ‘‘

MongoDB, Inc

2009-present, MongoDB, Inc.


mwah πŸ’‹ this page is from libmongoc version 2.5.6, dated Oct 09, 202 β€” periodt, go slay those structured logs πŸ’…βœ¨

πŸ“¦ where this page comes from