vishalanandl177 / DRF-API-Logger

An API Logger for your Django Rest Framework project.
https://github.com/vishalanandl177/DRF-API-Logger
Apache License 2.0
308 stars 56 forks source link

Make table creation independent of DRF_API_LOGGER_DATABASE #55

Closed zned45 closed 2 years ago

zned45 commented 2 years ago

Usage of multiple schemas with DRF_API_LOGGER_DATABASE does not work, because DRF-API-Logger is not aware of different schemas. The option is to use a logger signal and disable automatic logs. Unfortunately when DRF_API_LOGGER_DATABASE is set to false all database migrations are not applied.

Solution: Make database migrations and all model function independent from DRF_API_LOGGER_DATABASE.

zned45 commented 2 years ago

If you setup the queue size to 1, you can workaround this problem.

vishalanandl177 commented 2 years ago

Hi @zned45, Some of the developers don't want to store the logs in the database instead they want to use only the signals. So the creation of a model is useless for them.

If you want to log the info into any other database schema use DRF_API_LOGGER_DEFAULT_DATABASE = 'DB_ALIAS'