aboutsummaryrefslogtreecommitdiff
path: root/cmd/app/main.go
diff options
context:
space:
mode:
authorjloup <jloup@jloup.work>2018-05-16 12:30:58 +0200
committerjloup <jloup@jloup.work>2018-05-16 12:33:27 +0200
commitb718a3fc019f75fb175107329652d1db8a35a562 (patch)
tree67880be88e17537e6384fc020ef4c91ba3502eae /cmd/app/main.go
parentaa6fe2443b7b7fd6fc4e1540c0d891ee663b5ca0 (diff)
downloadFront-b718a3fc019f75fb175107329652d1db8a35a562.tar.gz
Front-b718a3fc019f75fb175107329652d1db8a35a562.tar.zst
Front-b718a3fc019f75fb175107329652d1db8a35a562.zip
Attempt to log to systemd.
Diffstat (limited to 'cmd/app/main.go')
-rw-r--r--cmd/app/main.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/app/main.go b/cmd/app/main.go
index 3f071de..d663e3d 100644
--- a/cmd/app/main.go
+++ b/cmd/app/main.go
@@ -12,6 +12,7 @@ import (
12 "github.com/gin-contrib/cors" 12 "github.com/gin-contrib/cors"
13 "github.com/gin-gonic/gin" 13 "github.com/gin-gonic/gin"
14 "github.com/jloup/utils" 14 "github.com/jloup/utils"
15 "github.com/wercker/journalhook"
15) 16)
16 17
17var log = utils.StandardL().WithField("module", "api") 18var log = utils.StandardL().WithField("module", "api")
@@ -60,6 +61,7 @@ func init() {
60 panic(err) 61 panic(err)
61 } 62 }
62 63
64 journalhook.Enable()
63 api.SetConfig(C.Api.Config) 65 api.SetConfig(C.Api.Config)
64 api.SetMailConfig(C.Mail) 66 api.SetMailConfig(C.Mail)
65 67
@@ -115,7 +117,7 @@ func main() {
115 117
116 engine.Use(gin.Recovery()) 118 engine.Use(gin.Recovery())
117 119
118 if C.Mode == "production" { 120 if C.Mode == "prod" {
119 engine.Use(api.Logger()) 121 engine.Use(api.Logger())
120 apiGroup.Use(api.Logger()) 122 apiGroup.Use(api.Logger())
121 } else { 123 } else {