about summary refs log tree commit diff stats
path: root/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server.go')
-rw-r--r--server.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/server.go b/server.go
index 0681a34..5ed4561 100644
--- a/server.go
+++ b/server.go
@@ -3,6 +3,7 @@ package main
 import (
 	"embed"
 	"fmt"
+	"io"
 	"log"
 	"net/http"
 	"os"
@@ -123,8 +124,14 @@ func main() {
 	toplevel.Get("/health", func(c *fiber.Ctx) error {
 		return c.SendStatus(fiber.StatusOK)
 	})
+	var logWriter io.Writer
+	if config.Production {
+		logWriter = law.NewWriteAsyncer(os.Stdout, nil)
+	} else {
+		logWriter = os.Stdout
+	}
 	toplevel.Use(skip.New(logger.New(logger.Config{
-		Output: law.NewWriteAsyncer(os.Stdout, nil),
+		Output: logWriter,
 		Format: "${protocol} ${method} ${status} ${host} ${url} ${respHeader:Location}\n",
 	}), func(c *fiber.Ctx) bool {
 		return c.Hostname() == "fly-internal"