about summary refs log tree commit diff
path: root/main.go
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-12-02T11·03+0100
committerFlorian Klink <flokli@flokli.de>2019-12-02T11·03+0100
commit118a88dace6e825e8cb713e644f5bcbcb753737b (patch)
tree688c462ac68c6464dd1a235eb383ca6aac2c88d7 /main.go
parent04a24a0c601c28d01e1110fb82f57c7a7c3f5d74 (diff)
add rotatingloghandler which removes older log entries
Diffstat (limited to 'main.go')
-rw-r--r--main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/main.go b/main.go
index 1be379904b29..338be7865b9e 100644
--- a/main.go
+++ b/main.go
@@ -10,12 +10,12 @@ import (
 
 	"github.com/tweag/gerrit-queue/frontend"
 	"github.com/tweag/gerrit-queue/gerrit"
+	"github.com/tweag/gerrit-queue/misc"
 	"github.com/tweag/gerrit-queue/submitqueue"
 
 	"github.com/urfave/cli"
 
 	"github.com/apex/log"
-	"github.com/apex/log/handlers/memory"
 	"github.com/apex/log/handlers/multi"
 	"github.com/apex/log/handlers/text"
 )
@@ -78,11 +78,11 @@ func main() {
 		},
 	}
 
-	memoryLogHandler := memory.New()
+	rotatingLogHandler := misc.NewRotatingLogHandler(10000)
 	l := &log.Logger{
 		Handler: multi.New(
 			text.New(os.Stderr),
-			memoryLogHandler,
+			rotatingLogHandler,
 		),
 		Level: log.DebugLevel,
 	}
@@ -96,7 +96,7 @@ func main() {
 
 		runner := submitqueue.NewRunner(l, gerrit, submitQueueTag)
 
-		handler := frontend.MakeFrontend(memoryLogHandler, gerrit, runner)
+		handler := frontend.MakeFrontend(rotatingLogHandler, gerrit, runner)
 
 		// fetch only on first run
 		runner.Trigger(fetchOnly)