Configuration Reference
Quick reference for all fapilog settings with their environment variable names and builder API equivalents.
Looking for a specific setting? Use Ctrl+F / Cmd+F to search by name.
Environment Variable Naming
Pattern: FAPILOG_<SECTION>__<SETTING>
Use double underscore (
__) to separate nested levelsAll uppercase
Examples:
core.log_level→FAPILOG_CORE__LOG_LEVELsink_config.rotating_file.max_bytes→FAPILOG_SINK_CONFIG__ROTATING_FILE__MAX_BYTESfilter_config.sampling.sample_rate→FAPILOG_FILTER_CONFIG__SAMPLING__SAMPLE_RATE
Type conversion: Environment variables are strings. Fapilog automatically converts:
Booleans:
true,false,1,0,yes,no,on,offIntegers:
100,10000Floats:
0.5,1.0Durations:
5s,1m,30s,daily,hourlySizes:
10 MB,1 GB,256 KBLists:
["a", "b"](JSON) ora,b,c(CSV)Dicts:
{"key": "value"}(JSON only)
Core Settings
Settings path: core.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Logical application name |
|
|
|
|
Default log level (DEBUG, INFO, WARNING, ERROR) |
|
|
|
|
Maximum in-memory queue size |
|
|
|
|
Protected queue capacity; None derives from main |
|
|
|
|
Maximum events per batch |
|
|
|
|
Max time before flushing partial batch |
|
|
|
|
Kept for backward compatibility; enqueue is always non-blocking |
|
|
|
|
Drop events when queue is full (always non-blocking) |
|
|
|
|
Enable Prometheus-compatible metrics |
|
|
|
|
Number of worker tasks for flush processing (see Validation Limits below) |
|
|
|
|
Maximum time to flush on shutdown |
|
|
|
|
Seconds to suppress duplicate ERROR logs |
Context and Diagnostics
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable per-task bound context |
|
|
|
|
Default bound context at logger creation |
|
|
|
|
Emit DEBUG/WARN diagnostics for internal errors |
|
|
|
|
Output stream: stderr or stdout |
Exception Handling
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Enable structured exception serialization |
|
|
|
|
Maximum stack frames to capture |
|
|
|
|
Maximum total characters for stack string |
|
|
|
|
Install unhandled exception hooks |
Graceful Shutdown
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Register atexit handler for log drain |
|
|
|
|
Maximum seconds for atexit drain |
|
|
|
|
Install SIGTERM/SIGINT handlers |
|
|
|
|
Immediately flush ERROR/CRITICAL logs |
Circuit Breaker
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Enable circuit breaker for sinks |
|
|
|
|
Consecutive failures before opening |
|
|
|
|
Seconds before probing failed sink |
|
|
|
|
Fan-out writes across multiple sinks in parallel |
|
|
|
|
Max concurrent event writes per worker per batch flush. Unlike |
Redaction Settings
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable redactors stage |
|
|
|
|
Redactor plugins to use |
|
|
Settings only |
|
Order of redactor application |
|
|
|
|
Max nested depth for redaction |
|
|
|
|
Max keys scanned during redaction |
|
|
|
|
Redaction mode for fallback: inherit, minimal, none |
|
|
|
|
Behavior on redaction failure: open, closed, warn |
|
|
|
|
Apply keyword scrubbing to raw fallback |
|
|
|
|
Optional byte limit for raw fallback |
Drop/Dedupe Visibility
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Emit summary when events dropped |
|
|
|
|
Window for aggregating summaries |
Plugin Selection
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Sink plugins to use |
|
|
|
|
Enricher plugins to use |
|
|
|
|
Filter plugins to apply |
|
|
Settings only |
|
Processor plugins to use |
Advanced
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Drop on envelope serialization failure |
|
|
Settings only |
|
Pre-serialize envelopes in flush |
|
|
Settings only |
|
Default max size for resource pools |
|
|
Settings only |
|
Default acquire timeout for pools |
|
|
Settings only |
|
Optional list for sensitive fields warning |
Validation Limits
Configuration values are validated at logger creation. Invalid values raise ValueError.
Hard limits (rejected if violated):
Setting |
Minimum |
Error |
|---|---|---|
|
1 |
|
|
1 |
|
|
>0 |
|
|
1 |
|
Soft limits (warning emitted via diagnostics):
Setting |
Warning Threshold |
Recommendation |
|---|---|---|
|
>32 |
More workers increase memory and context-switching overhead |
|
>1,000,000 |
Large queues consume significant memory |
|
>10,000 |
Very large batches may cause latency spikes |
Relationship warning:
If batch_max_size > max_queue_size, a warning is emitted because batches can never reach their maximum size.
Adaptive Pipeline Settings
Settings path: adaptive.*
Short env var aliases are available (e.g., FAPILOG_ADAPTIVE__ENABLED).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Enable adaptive pipeline controller |
|
|
|
|
Seconds between queue pressure samples |
|
|
|
|
Minimum seconds between pressure level transitions |
|
|
Settings only |
|
Fill ratio to escalate NORMAL to ELEVATED |
|
|
Settings only |
|
Fill ratio to escalate ELEVATED to HIGH |
|
|
Settings only |
|
Fill ratio to escalate HIGH to CRITICAL |
|
|
Settings only |
|
Fill ratio to de-escalate ELEVATED to NORMAL |
|
|
Settings only |
|
Fill ratio to de-escalate HIGH to ELEVATED |
|
|
Settings only |
|
Fill ratio to de-escalate CRITICAL to HIGH |
|
|
|
|
Maximum workers when dynamic scaling is active |
|
|
|
|
Enable adaptive batch sizing |
|
|
|
|
Pressure boost per open circuit breaker |
|
|
|
|
Enable adaptive filter tightening based on pressure level |
|
|
|
|
Enable dynamic worker scaling based on pressure level |
Sink Settings
Rotating File Sink
Settings path: sink_config.rotating_file.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Log directory |
|
|
Settings only |
|
Filename prefix |
|
|
Settings only |
|
Output format: json or text |
|
|
|
|
Max bytes before rotation |
|
|
|
|
Rotation interval (hourly, daily, etc.) |
|
|
|
|
Max rotated files to keep |
|
|
Settings only |
|
Max total bytes across all files |
|
|
|
|
Compress rotated files with gzip |
HTTP Sink
Settings path: sink_config.http.* or http.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
HTTP endpoint URL |
|
|
|
|
Default headers |
|
|
Settings only |
|
JSON-encoded headers map |
|
|
|
|
Request timeout |
|
|
Settings only |
|
Max retry attempts |
|
|
Settings only |
|
Base backoff between retries |
|
|
Settings only |
|
Events per HTTP request |
|
|
Settings only |
|
Max seconds before flush |
|
|
Settings only |
|
Format: array, ndjson, wrapped |
|
|
Settings only |
|
Wrapper key when format=wrapped |
Webhook Sink
Settings path: sink_config.webhook.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Webhook destination URL |
|
|
|
|
Shared secret for signing |
|
|
|
|
Additional HTTP headers |
|
|
|
|
Request timeout |
|
|
Settings only |
|
Max retry attempts |
|
|
Settings only |
|
Backoff between retries |
|
|
Settings only |
|
Events per request |
|
|
Settings only |
|
Max seconds before flush |
CloudWatch Sink
Settings path: sink_config.cloudwatch.*
Short env var aliases are available (e.g., FAPILOG_CLOUDWATCH__REGION).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
CloudWatch log group name |
|
|
|
|
Log stream name |
|
|
|
|
AWS region |
|
|
|
|
Custom endpoint (LocalStack) |
|
|
|
|
Create log group if missing |
|
|
|
|
Create log stream if missing |
|
|
|
|
Events per batch |
|
|
|
|
Max seconds before flush |
|
|
|
|
Max retries for PutLogEvents |
|
|
|
|
Base delay for backoff |
|
|
|
|
Enable circuit breaker |
|
|
|
|
Failures before opening |
Loki Sink
Settings path: sink_config.loki.*
Short env var aliases are available (e.g., FAPILOG_LOKI__URL).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Loki push endpoint |
|
|
|
|
Multi-tenant identifier |
|
|
|
|
Static labels for streams |
|
|
|
|
Event keys to promote to labels |
|
|
|
|
Events per batch |
|
|
|
|
Max seconds before flush |
|
|
|
|
HTTP timeout |
|
|
|
|
Max retries on failure |
|
|
|
|
Base delay for backoff |
|
|
|
|
Basic auth username |
|
|
|
|
Basic auth password |
|
|
|
|
Bearer token |
|
|
|
|
Enable circuit breaker |
|
|
|
|
Failures before opening |
PostgreSQL Sink
Settings path: sink_config.postgres.*
Short env var aliases are available (e.g., FAPILOG_POSTGRES__HOST).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Full connection string |
|
|
|
|
Database host |
|
|
|
|
Database port |
|
|
|
|
Database name |
|
|
|
|
Username |
|
|
|
|
Password |
|
|
|
|
Target table |
|
|
|
|
Database schema |
|
|
|
|
Auto-create table |
|
|
|
|
Minimum pool connections |
|
|
|
|
Maximum pool connections |
|
|
|
|
Pool acquire timeout |
|
|
|
|
Events per batch |
|
|
|
|
Max seconds before flush |
|
|
|
|
Max retries |
|
|
|
|
Base delay for backoff |
|
|
|
|
Enable circuit breaker |
|
|
|
|
Failures before opening |
|
|
|
|
Use JSONB column type |
|
|
|
|
Store full event JSON |
|
|
|
|
Fields to promote to columns |
Sealed Sink (Tamper-Evident)
Settings path: sink_config.sealed.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Inner sink to wrap |
|
|
Settings only |
|
Inner sink configuration |
|
|
Settings only |
|
Manifest directory |
|
|
Settings only |
|
Sign manifests when keys available |
|
|
Settings only |
|
Signing key identifier |
|
|
Settings only |
|
Key provider for signing |
|
|
Settings only |
|
Chain state directory |
|
|
Settings only |
|
Reset chain on rotation |
|
|
Settings only |
|
Fsync on every write |
|
|
Settings only |
|
Fsync after rotation |
|
|
Settings only |
|
Compress rotated files |
|
|
Settings only |
|
Sign via external KMS |
Sink Routing
Settings path: sink_routing.*
Short env var aliases are available (e.g., FAPILOG_SINK_ROUTING__ENABLED).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Enable level-based routing |
|
|
|
|
Routing rules in priority order |
|
|
|
|
Allow multiple rule matches |
|
|
|
|
Sinks when no rules match |
Routing rules format:
[
{"levels": ["ERROR", "CRITICAL"], "sinks": ["cloudwatch"]},
{"levels": ["INFO", "DEBUG"], "sinks": ["file"]}
]
Redaction Settings
Field Mask Redactor
Settings path: redactor_config.field_mask.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Field names to mask |
|
|
|
|
Replacement string |
|
|
|
|
Block if redaction fails |
|
|
Settings only |
|
Max nested depth |
|
|
Settings only |
|
Max keys to scan |
Regex Mask Redactor
Settings path: redactor_config.regex_mask.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Regex patterns to mask |
|
|
|
|
Replacement string |
|
|
|
|
Block if redaction fails |
|
|
Settings only |
|
Max nested depth |
|
|
Settings only |
|
Max keys to scan |
URL Credentials Redactor
Settings path: redactor_config.url_credentials.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Max string length to parse |
Redaction presets: For compliance-ready redaction, see the Redaction Presets documentation covering GDPR_PII, HIPAA_PHI, PCI_DSS, CREDENTIALS, and more.
Filter Settings
Sampling Filter
Settings path: filter_config.sampling.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Sample rate 0.0-1.0 |
|
|
|
|
Random seed for reproducibility |
Adaptive Sampling Filter
Settings path: filter_config.adaptive_sampling.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Minimum sample rate |
|
|
|
|
Maximum sample rate |
|
|
|
|
Target throughput |
|
|
|
|
Measurement window |
Trace Sampling Filter
Settings path: filter_config.trace_sampling.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Default rate when no trace context |
|
|
|
|
Honor upstream decisions |
Rate Limit Filter
Settings path: filter_config.rate_limit.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Token bucket capacity |
|
|
|
|
Tokens per second |
|
|
|
|
Field for partitioning |
|
|
|
|
Max buckets |
|
|
|
|
Action: drop or mark |
First Occurrence Filter
Settings path: filter_config.first_occurrence.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Dedup window |
|
|
|
|
Max tracked messages |
|
|
|
|
Fields for dedup key |
Processor Settings
Size Guard Processor
Settings path: processor_config.size_guard.*
Short env var aliases are available (e.g., FAPILOG_SIZE_GUARD__MAX_BYTES).
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Maximum payload size |
|
|
|
|
Action: truncate, drop, warn |
|
|
|
|
Fields to never remove |
Observability Settings
Settings path: observability.*
Monitoring
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable health/monitoring |
|
|
Settings only |
|
Monitoring endpoint URL |
Metrics
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable metrics collection |
|
|
Settings only |
|
Exporter: prometheus or none |
|
|
Settings only |
|
Metrics exporter port |
Tracing
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable distributed tracing |
|
|
Settings only |
|
Provider: otel or none |
|
|
Settings only |
|
Trace sampling rate 0.0-1.0 |
Logging
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Output format: json or text |
|
|
Settings only |
|
Include correlation IDs |
|
|
Settings only |
|
Log sampling rate (deprecated) |
Alerting
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
Enable alerting |
|
|
Settings only |
|
Minimum alert severity |
Plugin Settings
Settings path: plugins.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
|
|
Enable plugin loading |
|
|
|
|
Allow entry point plugins |
|
|
|
|
Only allow these plugins |
|
|
|
|
Block these plugins |
|
|
|
|
Mode: disabled, warn, strict |
Enricher Settings
Integrity Enricher (Tamper-Evident)
Settings path: enricher_config.integrity.*
Setting |
Env Var |
Builder Method |
Default |
Description |
|---|---|---|---|---|
|
|
Settings only |
|
MAC algorithm: sha256 or ed25519 |
|
|
Settings only |
|
Key identifier |
|
|
Settings only |
|
Key provider |
|
|
Settings only |
|
Chain state directory |
|
|
Settings only |
|
Reset chain after rotation |
|
|
Settings only |
|
Sign via KMS provider |
See Also
Configuration Guide - Detailed configuration guide with examples
Environment Variables - Full env var reference
Builder API - LoggerBuilder API reference
Redaction Presets - Compliance-ready redaction presets