package
module
Version:
v0.0.2
Opens a new window with list of versions in this module.
Published: Apr 19, 2022
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
gologger
json formatted logger for gofiber framework
Usage
package main
import (
"github.com/gofiber/fiber"
"github.com/vasuvanka/gologger"
)
func main() {
app := fiber.New()
app.Use(gologger.Log)
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World 👋!")
})
app.Listen(3000)
}
License
MIT
Free Software
Documentation
¶
Log - logger will print JSON formatted logs onto STDOUT
type LogStruct struct {
IP string `json:"ip"`
URL string `json:"url"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Duration int64 `json:"duration"`
Agent string `json:"agent"`
Status int `json:"status"`
Method string `json:"method"`
}
LogStruct - logger structure
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.