diff --git a/guide/src/qs_4_5.md b/guide/src/qs_4_5.md index dcdea3fe5..5a11af733 100644 --- a/guide/src/qs_4_5.md +++ b/guide/src/qs_4_5.md @@ -134,3 +134,18 @@ fn index(req: HttpRequest) -> Result<&'static str> { ``` In this example *BAD REQUEST* response get generated for `MyError` error. + +## Error logging + +Actix logs all errors with `WARN` log level. If log level set to `DEBUG` +and `RUST_BACKTRACE` is enabled, backtrace get logged. The Error type uses +cause's error backtrace if available, if the underlying failure does not provide +a backtrace, a new backtrace is constructed pointing to that conversion point +(rather than the origin of the error). This construction only happens if there +is no underlying backtrace; if it does have a backtrace no new backtrace is constructed. + +You can enable backtrace and debug logging with following command: + +``` +>> RUST_BACKTRACE=1 RUST_LOG=actix_web=debug cargo run +```