Closed samjo-nyang closed 7 years ago
Changes:
apps/logger.py
collect-logs
send-mail
Features:
logger.***
DEBUG
Usages:
import logging from apps.core.models import UserLog logger = logging.getLogger(UserLog.GROUP_XXX)
logger.info('login.try', {'r': request: 'uid': 'abcedf', 'extra': {'a': 1, 'b': 2}, 'hide': True})
(UserLog.GROUP_XXX).login.try: a=1, b=2
Changes:
apps/logger.py
collect-logs
custom django scriptsend-mail
custom django scriptFeatures:
logger.***
calledDEBUG
is false, high-level logs are sent to admin emailUsages:
logger.info('login.try', {'r': request: 'uid': 'abcedf', 'extra': {'a': 1, 'b': 2}, 'hide': True})
(UserLog.GROUP_XXX).login.try: a=1, b=2