towerops/config/prod.exs
Graham McIntire 2ef66464b8
refactor: filter harmless Oban shutdown messages during deployments
When Kubernetes performs rolling deployments, the old pod gracefully shuts down
and Oban's internal processes receive EXIT :shutdown signals. These are logged
as "unexpected" even though they're normal during shutdown.

Added custom logger filter to drop these messages in production:
- Oban.Queue.Watchman/Producer receiving EXIT :shutdown
- Oban plugin processes receiving EXIT :shutdown
- Reduces log noise during deployments without hiding real errors

The filter is production-only to preserve full debugging in development.
2026-01-25 08:38:33 -06:00

28 lines
857 B
Elixir

import Config
# Filter out harmless Oban shutdown messages during deployments
config :logger, :default_handler,
filters: [
drop_oban_shutdown: {
&Towerops.LoggerFilters.drop_oban_shutdown/2,
[]
}
]
# Do not print debug messages in production
config :logger,
level: :info,
metadata_filter: [oban_shutdown_filter: true]
# Configure Swoosh API Client
config :swoosh, api_client: Swoosh.ApiClient.Req
# Disable Swoosh Local Memory Storage
config :swoosh, local: false
# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :towerops, ToweropsWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"