diff --git a/CHANGES.md b/CHANGES.md index cb5f51126..d64a22397 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,16 @@ # Changes +## [1.0.5] - ? + +### Added + +* Actix now logs errors resulting in "internal server error" responses always, with the `error` + logging level + +### Fixed + +* Restored logging of errors through the `Logger` middleware + ## [1.0.4] - 2019-07-17 ### Added diff --git a/actix-http/src/response.rs b/actix-http/src/response.rs index ce986a472..124bf5f92 100644 --- a/actix-http/src/response.rs +++ b/actix-http/src/response.rs @@ -52,6 +52,9 @@ impl Response
{ #[inline] pub fn from_error(error: Error) -> Response { let mut resp = error.as_response_error().render_response(); + if resp.head.status == StatusCode::INTERNAL_SERVER_ERROR { + error!("Internal Server Error: {:?}", error); + } resp.error = Some(error); resp } diff --git a/src/middleware/logger.rs b/src/middleware/logger.rs index 9e332fb83..f450f0481 100644 --- a/src/middleware/logger.rs +++ b/src/middleware/logger.rs @@ -9,12 +9,13 @@ use actix_service::{Service, Transform}; use bytes::Bytes; use futures::future::{ok, FutureResult}; use futures::{Async, Future, Poll}; +use log::debug; use regex::Regex; use time; use crate::dev::{BodySize, MessageBody, ResponseBody}; use crate::error::{Error, Result}; -use crate::http::{HeaderName, HttpTryFrom}; +use crate::http::{HeaderName, HttpTryFrom, StatusCode}; use crate::service::{ServiceRequest, ServiceResponse}; use crate::HttpResponse; @@ -202,6 +203,12 @@ where fn poll(&mut self) -> Poll