Fix log exception.
Use raven to send logs to sentry.
Fixed logging middleware.