Skip to content

Hide Sensitive Data From Logs and Change default database to store API logs

Compare
Choose a tag to compare
@vishalanandl177 vishalanandl177 released this 04 Jun 15:08
· 79 commits to master since this release

You may wish to hide sensitive information from being exposed in the logs.
You do this by setting DRF_API_LOGGER_EXCLUDE_KEYS in settings.py to a list of your desired sensitive keys.
The default is
DRF_API_LOGGER_EXCLUDE_KEYS = ['password', 'token', 'access', 'refresh']
Sensitive data will be replaced with "FILTERED".

You can specify the database where to store DRF API Logger logs by specifying DRF_API_LOGGER_DEFAULT_DATABASE.
DRF_API_LOGGER_DEFAULT_DATABASE = 'default' # Default to "default" if not specified
Make sure to migrate the database specified in DRF_API_LOGGER_DEFAULT_DATABASE.