Configuration
LogChef uses a TOML configuration file to manage its settings. This guide explains all available configuration options.
Server Settings
Configure the HTTP server and frontend settings:
[server]# Port for the HTTP server (default: 8125)port = 8125
# Host address to bind to (default: "0.0.0.0")host = "0.0.0.0"
# URL of the frontend application# Leave empty in production, used only in developmentfrontend_url = ""
Database Configuration
SQLite database settings for storing metadata:
[sqlite]# Path to the SQLite database filepath = "logchef.db"
Authentication
OpenID Connect (OIDC)
Configure your SSO provider (example using Dex):
[oidc]# URL of your OIDC providerprovider_url = "http://dex:5556/dex"
# Authentication endpoint URL (Optional: often discovered via provider_url)auth_url = "http://dex:5556/dex/auth"
# Token endpoint URL (Optional: often discovered via provider_url)token_url = "http://dex:5556/dex/token"
# OIDC client credentialsclient_id = "logchef"client_secret = "logchef-secret"
# Callback URL for OIDC authentication# Must match the URL configured in your OIDC providerredirect_url = "http://localhost:8125/api/v1/auth/callback"
# Required OIDC scopesscopes = ["openid", "email", "profile"]
Auth Settings
Configure authentication behavior:
[auth]# List of email addresses that have admin privilegesadmin_emails = ["admin@corp.internal"]
# Duration of user sessions (e.g., "8h", "24h", "7d")session_duration = "8h"
# Maximum number of concurrent sessions per usermax_concurrent_sessions = 1
Logging
Configure application logging:
[logging]# Log level: "debug", "info", "warn", "error"level = "info"
Environment Variables
All configuration options can also be set using environment variables. The format is:
LOGCHEF_SECTION_KEY=value
Examples:
# Set server portLOGCHEF_SERVER_PORT=8125
# Set OIDC provider URLLOGCHEF_OIDC_PROVIDER_URL=http://dex:5556/dex
# Set admin emailsLOGCHEF_AUTH_ADMIN_EMAILS=admin@example.com,another@example.com
Production Configuration
For production deployments, ensure you:
- Set appropriate
host
andport
values - Configure a secure
client_secret
for OIDC - Set the correct
redirect_url
matching your domain - Configure admin emails for initial access
- Adjust session duration based on your security requirements
- Set logging level to “info” or “warn”
Example Production Configuration
[server]port = 8125host = "0.0.0.0"
[sqlite]path = "/data/logchef.db"
[oidc]provider_url = "https://dex.example.com"client_id = "logchef"client_secret = "your-secure-secret"redirect_url = "https://logchef.example.com/api/v1/auth/callback"scopes = ["openid", "email", "profile"]
[auth]admin_emails = ["admin@example.com"]session_duration = "8h"max_concurrent_sessions = 1
[logging]level = "info"