> ## 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.

# Log Filtering

> Filter logs based on various criteria

Filter logs based on level, status, or HTTP method using Logixlysia's flexible filtering system.

## Basic Usage

```ts theme={null}
logixlysia({
  config: {
    logFilter: {
      level: ['ERROR', 'WARNING'],
      status: [500, 404],
      method: 'GET'
    }
  }
})
```

## Filter Types

### By Log Level

```ts theme={null}
logFilter: {
  level: ['ERROR', 'WARNING'] // Only log ERROR and WARNING messages
}
```

Available levels: `ERROR`, `WARNING`, `INFO`, `DEBUG`

### By HTTP Status

```ts theme={null}
logFilter: {
  status: [500, 404] // Only log 500 and 404 responses
}
```

### By HTTP Method

```ts theme={null}
logFilter: {
  method: 'GET' // Only log GET requests
}
```

Or multiple methods:

```ts theme={null}
logFilter: {
  method: ['POST', 'PUT']
}
```

### Combined Filters

```ts theme={null}
logFilter: {
  level: ['ERROR'],
  status: [500],
  method: ['POST', 'PUT']
}
```

## Environment-Specific Filters

```ts theme={null}
logFilter: process.env.NODE_ENV === 'production' 
  ? { level: ['ERROR'] }
  : null // Log everything in development
```

## Best Practices

* **Production**: Filter to essential logs only (errors and warnings)
* **Development**: Log everything for debugging
* **Security**: Filter sensitive routes and avoid logging sensitive data
* **Performance**: Use simple filters in production
