Logging
Integrates leverages Python’s logging library to log important events and errors.
This setup aids in debugging the application, identifying code issues, and tracking transactional events for security purposes.
The full configuration can be found in the back/integrates/settings/logger.py
file.
Handlers
Console
Console logging is primarily used during development. It offers a convenient way to monitor application activity directly in the terminal.
Bugsnag
Bugsnag is employed to report both handled and unhandled errors in the application.
These reports can be examined in the Bugsnag UI, providing contextual details and stack traces to facilitate quick debugging and resolution.
Access Bugsnag by signing into your Okta account. If the app is not visible, request access through help@fluidattacks.com.
Watchtower
Watchtower is utilized in production to send detailed transactional logs to Amazon CloudWatch, capturing all significant events within the application.
Access Amazon CloudWatch by signing into your Okta account.
If the AWS
app is not visible,
request access through help@fluidattacks.com.
Development considerations
Async handlers
When configuring a new logging handler, consider that async functions are extensively used within the codebase.
To avoid blocking the event loop, configure the handler for async compatibility, such as utilizing native asyncio support or employing a queue with separate thread processing (a boolean flag usually enables this).
Refer to the library documentation or consult the maintainer for detailed information.