|
SYNOPSISmongoc_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 VARIABLESThis is a full list of the captured environment variables.
When a file path is given for MONGODB_LOG_PATH,
each log instance (one stand-alone client or pool) will separately open this
file for append. The results are operating system specific. On UNIX-like
platforms each instance's output will be interleaved, in most cases without
splitting individual log messages. Notably on Windows the file will be opened
in exclusive mode by the first instance and subsequent instances will fail,
falling back on the default of stderr. Applications that use multiple
processes or multiple client pools will likely want to supply a log handler
that annotates each message with information about its originating log
instance.
Note that log level names are always case insensitive. This is a full list of recognized names, including allowed aliases:
RETURNSA newly allocated mongoc_structured_log_opts_t. AUTHORMongoDB, Inc COPYRIGHT2009-present, MongoDB, Inc.
|