mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-30 08:25:58 -05:00
fix(log): write each log category to its own file (#2206)
Previously, `makeLogHandler()` hardcoded "standard" as the logfile name passed to `getLogWriter()`, causing all log categories (`database`, `http`, `events`, `mail`) to write to `standard.log` instead of their own files. Add a logfile parameter to `makeLogHandler()` so each caller specifies its category name, producing `database.log`, `http.log`, `echo.log`, `events.log`, and `mail.log` as expected. Fixes https://github.com/go-vikunja/vikunja/issues/2177
This commit is contained in:
@@ -29,7 +29,7 @@ type MailLogger struct {
|
||||
|
||||
// NewMailLogger creates and initializes a new mail logger
|
||||
func NewMailLogger(configLogEnabled bool, configLogMail string, configLogMailLevel string, configLogFormat string) maillog.Logger {
|
||||
handler := makeLogHandler(configLogEnabled, configLogMail, configLogMailLevel, configLogFormat)
|
||||
handler := makeLogHandler(configLogEnabled, configLogMail, "mail", configLogMailLevel, configLogFormat)
|
||||
|
||||
mailLogger := &MailLogger{
|
||||
logger: slog.New(handler).With("component", "mail"),
|
||||
|
||||
Reference in New Issue
Block a user