From 118a88dace6e825e8cb713e644f5bcbcb753737b Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 2 Dec 2019 12:03:46 +0100 Subject: add rotatingloghandler which removes older log entries --- frontend/frontend.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'frontend') diff --git a/frontend/frontend.go b/frontend/frontend.go index abb5a3db4f70..f0ea46e497c9 100644 --- a/frontend/frontend.go +++ b/frontend/frontend.go @@ -11,10 +11,9 @@ import ( "github.com/rakyll/statik/fs" "github.com/tweag/gerrit-queue/gerrit" + "github.com/tweag/gerrit-queue/misc" _ "github.com/tweag/gerrit-queue/statik" // register static assets "github.com/tweag/gerrit-queue/submitqueue" - - "github.com/apex/log/handlers/memory" ) //loadTemplate loads a list of templates, relative to the statikFS root, and a FuncMap, and returns a template object @@ -48,7 +47,7 @@ func loadTemplate(templateNames []string, funcMap template.FuncMap) (*template.T } // MakeFrontend returns a http.Handler -func MakeFrontend(memoryHandler *memory.Handler, gerritClient *gerrit.Client, runner *submitqueue.Runner) http.Handler { +func MakeFrontend(rotatingLogHandler *misc.RotatingLogHandler, gerritClient *gerrit.Client, runner *submitqueue.Runner) http.Handler { router := gin.Default() projectName := gerritClient.GetProjectName() @@ -88,7 +87,7 @@ func MakeFrontend(memoryHandler *memory.Handler, gerritClient *gerrit.Client, ru "HEAD": HEAD, // History - "memory": memoryHandler, + "memory": rotatingLogHandler, }) }) return router -- cgit 1.4.1