mongoc_structured_log_opts_new - Man Page

Synopsis

mongoc_structured_log_opts_t *
mongoc_structured_log_opts_new (void);

Creates a new mongoc_structured_log_opts_t, filled with defaults captured from the current environment.

Sets a default log handler which would write a text representation of each log message to stderr, stdout, or another file configurable using MONGODB_LOG_PATH. This setting has no effect if the default handler is replaced using mongoc_structured_log_opts_set_handler().

Environment variable errors are non-fatal, and result in one-time warnings delivered as an unstructured log.

Per-component maximum levels are initialized equivalently to:

mongoc_structured_log_opts_set_max_level_for_all_components(opts, MONGOC_STRUCTURED_LOG_LEVEL_WARNING);
mongoc_structured_log_opts_set_max_levels_from_env(opts);

Environment Variables

This is a full list of the captured environment variables.

Note that log level names are always case insensitive. This is a full list of recognized names, including allowed aliases:

Returns

A newly allocated mongoc_structured_log_opts_t.

Author

MongoDB, Inc

Info

Feb 06, 2025 1.30.0 libmongoc