mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-02-01 22:47:40 +00:00
feat!: remove echo log options - unify with general http logging
This commit is contained in:
@@ -415,11 +415,6 @@
|
||||
"default_value": "stdout",
|
||||
"comment": "Whether to log http requests or not. Possible values are stdout, stderr, file or off to disable http logging."
|
||||
},
|
||||
{
|
||||
"key": "echo",
|
||||
"default_value": "off",
|
||||
"comment": "Echo has its own logging which usually is unnecessary, which is why it is disabled by default. Possible values are stdout, stderr, file or off to disable standard logging."
|
||||
},
|
||||
{
|
||||
"key": "events",
|
||||
"default_value": "off",
|
||||
|
||||
@@ -141,7 +141,6 @@ const (
|
||||
LogDatabase Key = `log.database`
|
||||
LogDatabaseLevel Key = `log.databaselevel`
|
||||
LogHTTP Key = `log.http`
|
||||
LogEcho Key = `log.echo`
|
||||
LogPath Key = `log.path`
|
||||
LogEvents Key = `log.events`
|
||||
LogEventsLevel Key = `log.eventslevel`
|
||||
@@ -405,7 +404,6 @@ func InitDefaultConfig() {
|
||||
LogDatabase.setDefault("off")
|
||||
LogDatabaseLevel.setDefault("WARNING")
|
||||
LogHTTP.setDefault("stdout")
|
||||
LogEcho.setDefault("off")
|
||||
LogPath.setDefault(ServiceRootpath.GetString() + "/logs")
|
||||
LogEvents.setDefault("off")
|
||||
LogEventsLevel.setDefault("INFO")
|
||||
|
||||
@@ -82,7 +82,6 @@ import (
|
||||
sentryecho "github.com/getsentry/sentry-go/echo"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
elog "github.com/labstack/gommon/log"
|
||||
"github.com/ulule/limiter/v3"
|
||||
)
|
||||
|
||||
@@ -116,14 +115,7 @@ func NewEcho() *echo.Echo {
|
||||
|
||||
e.HideBanner = true
|
||||
|
||||
if l, ok := e.Logger.(*elog.Logger); ok {
|
||||
if !config.LogEnabled.GetBool() || config.LogEcho.GetString() == "off" {
|
||||
l.SetLevel(elog.OFF)
|
||||
}
|
||||
l.EnableColor()
|
||||
l.SetHeader(log.ErrFmt)
|
||||
l.SetOutput(log.GetLogWriter(config.LogEcho.GetString(), "echo"))
|
||||
}
|
||||
e.Logger = log.NewEchoLogger(config.LogEnabled.GetBool(), config.LogHTTP.GetString(), config.LogFormat.GetString())
|
||||
|
||||
// Logger
|
||||
if config.LogEnabled.GetBool() && config.LogHTTP.GetString() != "off" {
|
||||
|
||||
Reference in New Issue
Block a user