Skip to content

Implements log_level for Logger middleware #3605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JackSpagnoli
Copy link

@JackSpagnoli JackSpagnoli commented Mar 26, 2025

PR Type

Feature

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

Adds a log_level method to the Logger middleware to allow middleware log level to be specified.

Defaults to INFO so no change is not breaking.

Closes #3604

@JackSpagnoli JackSpagnoli changed the title implements log level for Logger Implements log_level for Logger middleware Mar 26, 2025
@JackSpagnoli
Copy link
Author

I've tried adding unit tests using env_logger directed at a local buffer to capture log output, but I haven't got lifetimes working with it (env_logger Pipe requires 'static). I'm not sure what other approach to take so I'd appreciate some advice.

@robjtede robjtede added B-semver-minor A-web project: actix-web labels Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Suggestion] Allow log level to be specified for middleware::logger
2 participants