Django Logging

Definitely not this 😅
  • Loggers
  • Handlers
  • Filters
  • Formatters
'version': 1,
'disable_existing_loggers': True,
'root': { 
'level': 'WARNING',
'handlers': ['general'],
},
'formatters': {
'default': {
'format': '%(levelname)s %(asctime)s %(message)s'
}
},
'handlers': {
'general': {
'level': 'INFO',
'class': 'logging.handlers.WatchedFileHandler',
'formatter': 'default',
'filename': 'django/log/general.log'
},
'user': {
'level': 'INFO',
'class': 'logging.handlers.WatchedFileHandler',
'formatter': 'default',
'filename': 'django/log/user.log'
}
},
'loggers': {
'general': {
'level': 'INFO',
'handlers': ['general'],
'propagate': False,
},
'user': {
'level': 'INFO',
'handlers': ['user'],
'propagate': False,
}
}
User
|
---> Balance
|
---> Transactions
logger = logging.getLogger('user.balance.transactions')
'propagate': False

P.S: If you have any doubts drop me a message on Linkedin

--

--

--

Love exploring new technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

An Enterprise Data App Framework using Streamlit and Google Cloud

The Origin of the Bitface

Challenges in Securing Containers

De-Obfuscating the 1986 IOCCC winner’s code.

Multiple Indicator Trading Strategy in Python — A Full Guide.

Learn programming in a solid way, develop skills and turn your hobby into a job

CS373 | Nov. 1–7

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shanmukh

Shanmukh

Love exploring new technologies

More from Medium

Python : Django Web Framework

Django + DigitalOcean Spaces

All about Views in Django REST Framework(DRF) — GenericAPIView and Mixins