> ## Documentation Index
> Fetch the complete documentation index at: https://cyborg-encryption-copy.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Logger

The `Logger` class provides logging capabilities for CyborgDB operations.

## Configure Logger

```python theme={null}
def configure(self,
              level: str,
              to_file: bool = False,
              file_path: str = None)
```

Configures the logger with the specified log level and output options.

### Parameters

| Parameter   | Type   | Default                 | Description                                                                 |
| ----------- | ------ | ----------------------- | --------------------------------------------------------------------------- |
| `level`     | `str`  | -                       | Log level. Must be one of: "debug", "info", "warning", "error", "critical". |
| `to_file`   | `bool` | `False`                 | Whether to write logs to a file instead of stdout/stderr.                   |
| `file_path` | `str`  | `"cyborgdb_client.log"` | *(Optional)* Path to the log file. Only used when `to_file` is `True`.      |

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    * Throws if the log level is invalid.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
# Get the logger instance
logger = cyborgdb.Logger.instance()

# Configure logger to write INFO level logs to console
logger.configure(level="info")

# Configure logger to write ERROR level logs to a file
logger.configure(level="error", to_file=True, file_path="/path/to/logs/cyborgdb.log")
```

<Tip>The DEBUG level is only available in debug builds of the library.</Tip>
