teresantns / DesafioConstrudelas

Final project for the Construdelas academy, in which I built a loyalty program API
1 stars 0 forks source link

Add logging to project #15

Closed teresantns closed 2 years ago

teresantns commented 2 years ago

Logging allows us to keep a record on data input, processes, and results in a program, so we can monitor the application.

We will use the built-in python logging library in connection to django to implement some basic logging our existing API. We will also use the python-json-logger library to format our loggers.

Logging configuration:

I also used Gigek's django-drf-playground project to help me guide the best way to configure the logging.

teresantns commented 2 years ago

Currently the logging file is being displayed in the github repository, just for example sake. To change this, simply undo this commit i.e., add the .log extension to the gitignore file.

teresantns commented 2 years ago

Now we have a file to track warning and critical logs on the API requests, that uses the django.request extension, and another one to track the info logs we will put on the custom views of our model.