I have created an app on Heroku and I push my Django app to it.
I monitor the logs using heroku logs --tail
to see them in real time.
Then, in my
As stated in previous replies, the logger should be set up in the entry point to your app. In the case of a django based web server using gunicorn, that entry point is most likely the wsgi.py
file.
Try adding the required configuration to that file, e.g. setting the global basic logger:
import logging
import os
from dj_static import Cling
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "path.to.settings.py")
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(name)s %(levelname)-8s %(message)s",
)