Open folliehiyuki opened 11 months ago
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
Hi. Can you provide a proof-of-concept? If we can do it without breaking something on v2, it's OK to me. Otherwise, we have to adjust logger middleware on v3.
@FollieHiyuki
Can you provide a proof-of-concept? If we can do it without breaking something on v2, it's OK to me
I don't have a concrete idea how to do this cleanly right now.
Otherwise, we have to adjust logger middleware on v3.
That sounds reasonable to me. It's nothing urgent (at least for me) and also takes less effort (no need to keep the compatibility with the current template interface).
Hi, I would like to contribute this task as my first contribution to gofiber.
From what I read about the logger
middleware and the Logger
interface,
My first thought is that the target can be:
"making the logger.Config
struct’s LoggerFunc
field to accept the Logger
interface."
This could include some modifications on the defaultLoggerInstance
in the logger
middleware.
If there is anything I need to be aware of, please feel free to tell me.
Thanks!
Hi, I would like to contribute this task as my first contribution to gofiber.
From what I read about the
logger
middleware and theLogger
interface, My first thought is that the target can be: "making thelogger.Config
struct’sLoggerFunc
field to accept theLogger
interface."This could include some modifications on the
defaultLoggerInstance
in thelogger
middleware. If there is anything I need to be aware of, please feel free to tell me. Thanks!
Hi @haochunchang feel free to create a PR
Feature Description
With the introduction of
Logger
interface (https://github.com/gofiber/fiber/pull/2499), it is easier now to plug my own log library into Fiber. With that said,logger
middleware still usesfmt.Sprintf()
.It would be nice if
logger
middleware is extended to accept logging viaLogger
interface. This creates an easier method to have structure log for requests/responses without the need of making a custom external middleware. Judging from https://github.com/gofiber/fiber/issues/1293#issuecomment-829210674, if we want to keep the currentlogger
middleware as simple as it is, making a new logger middleware would also be reasonable.Additional Context (optional)
No response
Code Snippet (optional)
No response
Checklist: