-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Feature Description
As pointed out by @efectn in #2402 and #2432 (comment) xurrently we log everything using default logger like log.Print*
, this makes it hard to replace the standard logger with any other logger like logrus, zap etc.
We can add a logger interface and give an option to replace the default logger via fiber.Config
Additional Context (optional)
No response
Code Snippet (optional)
package main
import "github.com/gofiber/fiber/v2"
import "log"
func main() {
// Enable fiber to use slog to log messages.
app := fiber.New(fiber.Config{Logger: slog.New()})
log.Fatal(app.Listen(":3000"))
}
Checklist:
- I agree to follow Fiber's Code of Conduct.
- I have checked for existing issues that describe my suggestion prior to opening this one.
- I understand that improperly formatted feature requests may be closed without explanation.
gaby