Heroku dzienniki
heroku logs --tail
Condemned Crane
heroku logs --tail
# Display all logs live
heroku logs -t -a YOUR_APP_NAME
# Only display stdout of your app
heroku logs -t -s app -a YOUR_APP_NAME
#In the settings.py file:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': ('%(asctime)s [%(process)d] [%(levelname)s] ' +
'pathname=%(pathname)s lineno=%(lineno)s ' +
'funcname=%(funcName)s %(message)s'),
'datefmt': '%Y-%m-%d %H:%M:%S'
},
'simple': {
'format': '%(levelname)s %(message)s'
}
},
'handlers': {
'null': {
'level': 'DEBUG',
'class': 'logging.NullHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'testlogger': {
'handlers': ['console'],
'level': 'INFO',
}
}
}
#Then where you need it use
import logging
logger = logging.getLogger('testlogger')
logger.info('This is a simple log message')