Skip to content

Commit

Permalink
configure logger on worker initialization (#4624)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsachs committed Feb 21, 2024
1 parent cf63fba commit f213c20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ The types of changes are:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fides/compare/2.30.0...main)
## [Unreleased](https://github.com/ethyca/fides/compare/2.30.1...main)

## [2.30.1](https://github.com/ethyca/fides/compare/2.30.0...2.30.1)

### Fixed
- Configure logger correctly on worker initialization [#4624](https://github.com/ethyca/fides/pull/4624)


## [2.30.0](https://github.com/ethyca/fides/compare/2.29.0...2.30.0)

Expand Down
7 changes: 7 additions & 0 deletions src/fides/api/tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from sqlalchemy.orm import Session

from fides.api.db.session import get_db_engine, get_db_session
from fides.api.util.logger import create_handler_dicts
from fides.api.util.logger import setup as setup_logging
from fides.config import CONFIG, FidesConfig

MESSAGING_QUEUE_NAME = "fidesops.messaging"
Expand Down Expand Up @@ -44,6 +46,11 @@ def _create_celery(config: FidesConfig = CONFIG) -> Celery:
"""
Returns a configured version of the Celery application
"""
setup_logging(config)
logger.bind(api_config=CONFIG.logging.json()).debug(
"Logger configuration options in use"
)

app = Celery(__name__)

celery_config: Dict[str, Any] = {
Expand Down

0 comments on commit f213c20

Please sign in to comment.