tastypie와 함께 Django를 사용하고 오류 추적을 위해 Sentry를 사용하고 있습니다.Sentry에 tastypie 오류 메시지가 표시되지 않습니다.
tastypie에서 발생하는 오류는 오류 메시지를 로깅하지 않는 것이 문제입니다.
core.api.api_user.hydrate
Internal Server Error: /api/v1/test/123/
을하고 다음 메시지를 기록한다 :
그들은이 메시지와 함께 기록됩니다
core.api.api_user.hydrate
int() argument must be a string or a number, not 'dict'
및 스택 트레이스의 나머지.
이 내 프로젝트 로깅 설정입니다 : 내가 더 나은 내 오류를 기록 할 수있는 방법
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'root': {
'level': 'WARNING',
'handlers': ['sentry'],
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
},
'handlers': {
'sentry': {
'level': 'ERROR',
'class': 'raven.contrib.django.handlers.SentryHandler',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'verbose'
}
},
'loggers': {
'django.request.tastypie': {
"handlers": ["sentry"],
"level": "ERROR",
"propagate": False
},
'django.db.backends': {
'level': 'ERROR',
'handlers': ['console'],
'propagate': False,
},
'raven': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': False,
},
},
}
어떤 생각?
장고 1.4 Tastypie 0.9.11 보초 3.5.7
흠. 프로덕션 환경에서는 오류가 두 번 기록됩니다. 그래서 그것은 참입니다 :'DEBUG = True'는 django.request.tastypie가 기록되지 않았다는 것을 의미합니다. – ivy