Skip to content

Conversation

@aldas
Copy link
Contributor

@aldas aldas commented Dec 10, 2025

Security

Enhancements

  • Add middleware.RequestLogger function to replace middleware.Logger. middleware.RequestLogger uses default slog logger.
    Default slog logger output can be configured to JSON format like that:
    slog.SetDefault(slog.New(slog.NewJSONHandler(os.Stdout, nil)))
    e.Use(middleware.RequestLogger())
  • Deprecate middleware.Logger function and point users to middleware.RequestLogger and middleware.RequestLoggerWithConfig

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 85.43046% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.91%. Comparing base (f24aaff) to head (7a19984).
⚠️ Report is 21 commits behind head on master.

Files with missing lines Patch % Lines
middleware/logger_strings.go 71.42% 10 Missing and 10 partials ⚠️
middleware/request_logger.go 96.29% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2849      +/-   ##
==========================================
+ Coverage   93.25%   93.91%   +0.66%     
==========================================
  Files          39       40       +1     
  Lines        4652     3946     -706     
==========================================
- Hits         4338     3706     -632     
+ Misses        218      137      -81     
- Partials       96      103       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aldas
Copy link
Contributor Author

aldas commented Dec 10, 2025

@vishr I have added logger_strings.go file with this PR that contains (modified) code from Go standard library and that file has their license (BSD-3-Clause). Is this fine with you?

@aldas aldas merged commit c12cb08 into labstack:master Dec 11, 2025
21 of 29 checks passed
@aldas aldas deleted the logger_json_string_escaping branch December 11, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants