---
name: "mongoc_structured_log_opts_set_max_level_for_component"
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_opts_set_max_level_for_component"
---

# mongoc\_structured\_log\_opts\_set\_max\_level\_for\_component(3)

## SYNOPSIS

```
bool
mongoc_structured_log_opts_set_max_level_for_component (mongoc_structured_log_opts_t *opts,
                                                        mongoc_structured_log_component_t component,
                                                        mongoc_structured_log_level_t level);
```

Sets the maximum log level per-component. Only log messages at or below this severity level will be passed to *mongoc\_structured\_log\_func\_t*.

By default, each component's log level may come from environment variables. See *mongoc\_structured\_log\_opts\_set\_max\_levels\_from\_env()*.

## PARAMETERS

- •

  **opts**: Structured log options, allocated with *mongoc\_structured\_log\_opts\_new()*.

- •

  **component**: The component to set a max log level. for, as a *mongoc\_structured\_log\_component\_t*.

- •

  **level**: The new max log level for this component, as a *mongoc\_structured\_log\_level\_t*.

## RETURNS

Returns **true** on success, or **false** if the supplied parameters were incorrect.

**SEE ALSO:**

```
Structured Logging
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
