1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-15 01:34:53 +02:00

Added JSON logging

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-06-08 17:16:03 -07:00
parent 6783909459
commit f4088cf594
4 changed files with 20 additions and 12 deletions

View File

@ -2,7 +2,6 @@ package middleware
import (
"bytes"
"fmt"
"io"
"net"
"os"
@ -158,9 +157,8 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
return w.Write([]byte(b))
case "tx_bytes":
return w.Write([]byte(strconv.FormatInt(res.Size(), 10)))
default:
return w.Write([]byte(fmt.Sprintf("[unknown tag %s]", tag)))
}
return 0, nil
})
if err == nil {
config.Output.Write(buf.Bytes())