---
name: "mongoc_structured_log_component_t"
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_component_t"
---

# mongoc\_structured\_log\_component\_t(3)

## SYNOPSIS

```
typedef enum {
   MONGOC_STRUCTURED_LOG_COMPONENT_COMMAND = 0,
   MONGOC_STRUCTURED_LOG_COMPONENT_TOPOLOGY = 1,
   MONGOC_STRUCTURED_LOG_COMPONENT_SERVER_SELECTION = 2,
   MONGOC_STRUCTURED_LOG_COMPONENT_CONNECTION = 3,
} mongoc_structured_log_component_t;
```

**mongoc\_structured\_log\_component\_t** enumerates the structured logging components. Applications should never rely on having an exhaustive list of all log components. Instead, use *mongoc\_structured\_log\_opts\_set\_max\_level\_for\_all\_components()* to set a default level if needed.

## FUNCTIONS

### mongoc\_structured\_log\_get\_component\_name()

### Synopsis

```
const char *
mongoc_structured_log_get_component_name (mongoc_structured_log_component_t component);
```

### Parameters

- •

  **component**: Log component as a *mongoc\_structured\_log\_component\_t*.

### Returns

If the component is known, returns a pointer to a constant string that should not be freed. If the component has no known name, returns NULL.

**SEE ALSO:**

```
Structured Logging
```

### mongoc\_structured\_log\_get\_named\_component()

### Synopsis

```
bool
mongoc_structured_log_get_named_component (const char *name, mongoc_structured_log_component_t *out);
```

Look up a component by name. Case insensitive.

### Parameters

- •

  **name**: A name to look up as a log component.

- •

  **out**: On success, the corresponding *mongoc\_structured\_log\_component\_t* is written here.

### Returns

If the component name is known, returns **true** and writes the component enum to **\*out**. If the component name is not known, returns **false** and does not write **\*out**.

**SEE ALSO:**

```
Structured Logging
```

**SEE ALSO:**

```
Structured Logging
```

## AUTHOR

MongoDB, Inc

## COPYRIGHT

2009-present, MongoDB, Inc.
