logging update

This commit is contained in:
jpt 2025-04-19 19:06:39 -05:00
parent 3739e6966f
commit 4364d31a59
2 changed files with 11 additions and 9 deletions

View File

@ -17,10 +17,9 @@ Please note that the underlying libraries are under their own (MIT/BSD) licenses
If you are using this library as a baseline, there are a few steps you'll need to follow: If you are using this library as a baseline, there are a few steps you'll need to follow:
1. Replace all instances of "djeff" with your project name. 1. Replace pyproject.toml "djeff" with your project name.
2. Add a LICENSE 2. **Recommended:** run `uv run pre-commit install`
3. run `uv run pre-commit install` 3. Read through the various sections below to familiarize yourself with the setup.
4. Read through the various sections below to familiarize yourself with the setup.
A few of the libraries may require additional setup, documented under the **You:** steps below. A few of the libraries may require additional setup, documented under the **You:** steps below.
## File System Layout ## File System Layout

View File

@ -142,7 +142,7 @@ DJANGO_STRUCTLOG_USER_ID_FIELD = None
LOGGING = { LOGGING = {
"version": 1, "version": 1,
"disable_existing_loggers": False, "disable_existing_loggers": True,
"formatters": { "formatters": {
"json_formatter": { "json_formatter": {
"()": structlog.stdlib.ProcessorFormatter, "()": structlog.stdlib.ProcessorFormatter,
@ -180,10 +180,13 @@ LOGGING = {
"handlers": ["console", "flat_line_file", "json_file"], "handlers": ["console", "flat_line_file", "json_file"],
"level": "INFO", "level": "INFO",
}, },
"djeff": { # Modify this to match the name of your application.
"handlers": ["console", "flat_line_file", "json_file"], # to configure different logging for your app vs. Django's
"level": "INFO", # internals.
}, # "YOUR_APP": {
# "handlers": ["console", "flat_line_file", "json_file"],
# "level": "INFO",
# },
}, },
} }