Skip to content

🐛 [Bug]: logger locals:requestid not working #3436

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
3 tasks done
yokeTH opened this issue May 6, 2025 · 2 comments · May be fixed by #3441
Open
3 tasks done

🐛 [Bug]: logger locals:requestid not working #3436

yokeTH opened this issue May 6, 2025 · 2 comments · May be fixed by #3441
Assignees

Comments

@yokeTH
Copy link

yokeTH commented May 6, 2025

Bug Description

app.Use(requestid.New())

app.Use(logger.New(logger.Config{
    DisableColors: true,
    TimeFormat:    "2006-01-02 15:04:05",
    Format:        "${time} | ${locals:requestid} | ${status} | ${latency} | ${ip} | ${method} | ${path} | ${error}\n",
}))

I got this

2025-05-04 08:41:12 |  | 200 |   29.765084ms | 127.0.0.1 | GET | /books | -

How to Reproduce

Steps to reproduce the behavior:

  1. Use requestid v3
  2. Use logger v3 and log the locals:requestid

Expected Behavior

it should appear

2025-05-04 08:41:12 | 462FFBF9-77B3-4EBE-B994-0CAC0E2A31FF  | 200 |   29.765084ms | 127.0.0.1 | GET | /books | -

Fiber Version

v3.0.0-beta.4

Code Snippet (optional)

app.Use(requestid.New())

app.Use(logger.New(logger.Config{
    DisableColors: true,
    TimeFormat:    "2006-01-02 15:04:05",
    Format:        "${time} | ${locals:requestid} | ${status} | ${latency} | ${ip} | ${method} | ${path} | ${error}\n",
}))

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my problem prior to opening this one.
  • I understand that improperly formatted bug reports may be closed without explanation.
Copy link

welcome bot commented May 6, 2025

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@brunodmartins
Copy link
Contributor

I want to work on this issue!

@gaby gaby added the v3 label May 9, 2025
brunodmartins added a commit to brunodmartins/fiber that referenced this issue May 9, 2025
@brunodmartins brunodmartins linked a pull request May 9, 2025 that will close this issue
9 tasks
brunodmartins added a commit to brunodmartins/fiber that referenced this issue May 9, 2025
brunodmartins added a commit to brunodmartins/fiber that referenced this issue May 9, 2025
brunodmartins added a commit to brunodmartins/fiber that referenced this issue May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants