Skip to content

Commit

Permalink
Merge pull request #745 from marigonzes/patch-1
Browse files Browse the repository at this point in the history
Update LoggerConfig documentation
  • Loading branch information
Fenny authored Sep 1, 2020
2 parents f1a9d65 + ba67152 commit 733da09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions middleware/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ type (
// - form:<key>
// - cookie:<key>
//
// Optional. Default: ${time} - ${ip} - ${status} - ${latency} - ${method} ${path}\n
// Optional. Default: #${pid} - ${time} ${status} - ${latency} ${method} ${path}\n
Format string

// TimeFormat https://programming.guide/go/format-parse-string-time-date-example.html
//
// Optional. Default: 15:04:05
// Optional. Default: 2006/01/02 15:04:05
TimeFormat string

// TimeZone can be specified, such as "UTC" and "America/New_York" and "Asia/Chongqing", etc
Expand Down Expand Up @@ -213,7 +213,7 @@ func logger(config LoggerConfig) fiber.Handler {

var timestamp atomic.Value
timestamp.Store(nowTimeString(config.timeZoneLocation, config.TimeFormat))
// Update date/time every millisecond in a separate go routine
// Update date/time every 750 milliseconds in a separate go routine
if strings.Contains(config.Format, "${time}") {
go func() {
for {
Expand Down

0 comments on commit 733da09

Please sign in to comment.