Skip to content

Commit 43bf9fe

Browse files
committed
add log time
1 parent fa86926 commit 43bf9fe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import (
1212
log "github.com/sirupsen/logrus"
1313
)
1414

15+
func init() {
16+
customFormatter := new(log.TextFormatter)
17+
customFormatter.TimestampFormat = "2006-01-02 15:04:05"
18+
customFormatter.FullTimestamp = true
19+
log.SetFormatter(customFormatter)
20+
}
21+
1522
func main() {
1623
port := "9000"
1724
conf, err := LoadConfig("application.yml")

0 commit comments

Comments
 (0)