Django Integration
Logly provides a Django handler and middleware to capture request context and route all application logs through Logly.
Example
python
--8<-- "examples/django_integration.py"How It Works
- Add
LoglyHandlerto yourLOGGINGdict insettings.pyto forward Django log records to Logly. - Add
LoglyMiddlewaretoMIDDLEWAREto attach request context (method, path, status) to every log entry. - Logly's structured output replaces Django's default
LOGGINGconfiguration with richer formatting and filtering.
