# Auth Logs

Configure auth-specific logging separately from main Atmos logs. This is useful for debugging authentication issues without enabling verbose logging for all Atmos operations.

## Configuration

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Info                   # Debug, Info, Warn, Error
    file: /tmp/atmos-auth.log     # Optional file path
```

- **`level`**

  Log level for auth operations. Options:
  - `Debug` - Verbose output including credential flows
  - `Info` - Standard information about auth operations
  - `Warn` - Warnings only
  - `Error` - Errors only
- **`file`**
  Optional. Path to write auth logs. If not specified, logs go to stderr.

## Log Levels

### Debug

Use `Debug` level when troubleshooting authentication issues:

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Debug
```

Debug output includes:

- Provider initialization details
- Token refresh operations
- Credential resolution steps
- API call details (without secrets)

### Info (Default)

Standard logging for normal operations:

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Info
```

Info output includes:

- Authentication success/failure
- Identity selection
- Session expiration notices

### Warn

Only log warnings and errors:

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Warn
```

Warn output includes:

- Credential expiration warnings
- Fallback behavior notices
- Configuration deprecation warnings

### Error

Only log errors:

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Error
```

## Writing to File

For persistent logging or debugging in automated environments:

**File:** `atmos.yaml`

```yaml
auth:
  logs:
    level: Debug
    file: /var/log/atmos-auth.log
```

This is useful for:

- CI/CD debugging
- Post-mortem analysis
- Audit logging

:::note
The log file path must be writable by the user running Atmos. Parent directories must exist.
:::

## Separating Auth Logs from Main Logs

Auth logs are separate from main Atmos logs configured in the `logs` section:

**File:** `atmos.yaml`

```yaml
# Main Atmos logs
logs:
  level: Info
  file: /var/log/atmos.log

# Auth-specific logs (separate)
auth:
  logs:
    level: Debug
    file: /var/log/atmos-auth.log
```

This allows you to enable verbose auth logging without affecting other Atmos output.
