Skip to content

Commit a8c5d0e

Browse files
committed
Add README instructions for extending logging_conf
#3
1 parent b0a36de commit a8c5d0e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,21 @@ ENV APP_MODULE="package.custom.module:api" WORKERS_PER_CORE="2"
302302
### Logging
303303

304304
- `LOGGING_CONF`: Python module containing a logging [configuration dictionary object](https://docs.python.org/3/library/logging.config.html) named `LOGGING_CONFIG`. Can be either a module path (`inboard.logging_conf`) or a file path (`/app/inboard/logging_conf.py`). The `LOGGING_CONFIG` dictionary will be loaded and passed to [`logging.config.dictConfig()`](https://docs.python.org/3/library/logging.config.html). See [br3ndonland/inboard#3](https://github.com/br3ndonland/inboard/pull/3) for more details on logging setup.
305+
305306
- Default: `"inboard.logging_conf"` (the default module provided with inboard)
306307
- Custom: For a logging config module at `/app/package/custom_logging.py`, `LOGGING_CONF="package.custom_logging"` or `LOGGING_CONF="/app/package/custom_logging.py"`.
308+
- If inboard is installed from PyPI with `pip install inboard`, the logging configuration can be easily extended. For example,
309+
310+
```py
311+
# /app/package/custom_logging.py
312+
from inboard import logging_conf
313+
314+
LOGGING_CONFIG = logging_conf.LOGGING_CONFIG
315+
LOGGING_CONFIG["loggers"]["boto3"] = {"propagate": False}
316+
LOGGING_CONFIG["loggers"]["botocore"] = {"propagate": False}
317+
LOGGING_CONFIG["loggers"]["s3transfer"] = {"propagate": False}
318+
```
319+
307320
- `LOG_COLORS`: Whether or not to color log messages. Currently only supported for `LOG_FORMAT="uvicorn"`.
308321
- Default:
309322
- Auto-detected based on [`sys.stdout.isatty()`](https://docs.python.org/3/library/sys.html#sys.stdout).

0 commit comments

Comments
 (0)