> ## Documentation Index
> Fetch the complete documentation index at: https://logixlysia-claude-elysia-v2-open-beta-i2faib.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# File Logging

> Save logs to files for persistence

Save your logs to files for persistence and analysis using Logixlysia's file logging system.

## Basic Usage

```ts theme={null}
logixlysia({
  config: {
    logFilePath: './logs/app.log'
  }
})
```

## Configuration

| Option        | Type     | Description          | Default     |
| ------------- | -------- | -------------------- | ----------- |
| `logFilePath` | `string` | Path to the log file | `undefined` |

## File Format

Logs are written in a structured format:

```
🦊 2025-04-13 15:00:19.225 INFO  123.45ms GET /api/users 200 
🦊 2025-04-13 15:00:20.225 ERROR 234.56ms POST /api/users 500 Error creating user
```

## Best Practices

* Use descriptive file names
* Organize logs by type/level
* Consider using date-based directories
* Set appropriate file permissions
* Avoid logging sensitive data
* Regular log review and cleanup

## Examples

### Production

```ts theme={null}
logFilePath: './logs/production.log'
```

### Development

```ts theme={null}
logFilePath: './logs/development.log'
```

For advanced file management, see [Log Rotation](/docs/features/log-rotation).
