How to configure compatibility hooks¶
Configure ezplog so application logs and library logs follow one consistent policy.
🔧 Prerequisites¶
- ezplog installed
- A single application entrypoint where
Ezplis initialized
📝 Steps¶
-
Initialize
Ezplonce with explicit hook settings.
Why explicit hooks
Keeping compatibility settings explicit at startup makes runtime behavior predictable and easier to test.
-
Narrow stdlib interception when you only want selected namespaces.
-
Lock runtime configuration after bootstrap.
-
Persist intentional runtime updates.
⚙️ Variations¶
Use environment variables for deployment-only overrides.
Use a local configuration file for stable defaults.
{
"log-level": "INFO",
"file-logger-level": "DEBUG",
"log-rotation": "10 MB",
"log-retention": "14 days"
}
✅ Result¶
The application owns logging policy, while libraries stay passive and compatible. Hook behavior is explicit, testable, and can be scoped to specific logger names.