actix-web icon indicating copy to clipboard operation
actix-web copied to clipboard

feat: add ability to specify log level for access logger

Open tglman opened this issue 2 years ago • 1 comments

Hi,

This add a new feature to the Logger middleware to set the level of the log.

Example

Logger::default().level(Level::Debug);

This would ideally go together with https://github.com/actix/actix-web/pull/3086

PR Checklist

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

tglman avatar Oct 03 '23 21:10 tglman

Hi,

This is complete also, it may conflict with the pr: https://github.com/actix/actix-web/pull/3086 because it add the same deps for test the logs, I may rebase the one of the two pr based on the one that is merged before.

Regards

tglman avatar Oct 12 '23 20:10 tglman

Thanks for the work you've put into this.

I'm planning on migrating all the actix/* codebases over to tracing gradually, but dynamic logging levels is not something that's well supported by that ecosystem. The benefits definitely outweigh that but it means this PR is probably never going to land as-is.

We can revisit this idea after the tracing migration.

robjtede avatar Jun 10 '24 23:06 robjtede