fleet/server/service/logging_appconfig.go
Charlie Gildawie df93abd722
Reduce verbosity of default logging (#2225)
* Moves much logging from the info level to the debug level
* Tries to retain security/auditing relevant logs at info level
2020-04-22 14:01:34 -07:00

63 lines
1.2 KiB
Go

package service
import (
"context"
"time"
"github.com/kolide/fleet/server/kolide"
)
func (mw loggingMiddleware) NewAppConfig(ctx context.Context, p kolide.AppConfigPayload) (*kolide.AppConfig, error) {
var (
info *kolide.AppConfig
err error
)
defer func(begin time.Time) {
_ = mw.loggerDebug(err).Log(
"method", "NewAppConfig",
"err", err,
"took", time.Since(begin),
)
}(time.Now())
info, err = mw.Service.NewAppConfig(ctx, p)
return info, err
}
func (mw loggingMiddleware) AppConfig(ctx context.Context) (*kolide.AppConfig, error) {
var (
info *kolide.AppConfig
err error
)
defer func(begin time.Time) {
_ = mw.loggerDebug(err).Log(
"method", "AppConfig",
"err", err,
"took", time.Since(begin),
)
}(time.Now())
info, err = mw.Service.AppConfig(ctx)
return info, err
}
func (mw loggingMiddleware) ModifyAppConfig(ctx context.Context, p kolide.AppConfigPayload) (*kolide.AppConfig, error) {
var (
info *kolide.AppConfig
err error
)
defer func(begin time.Time) {
_ = mw.loggerDebug(err).Log(
"method", "ModifyAppConfig",
"err", err,
"took", time.Since(begin),
)
}(time.Now())
info, err = mw.Service.ModifyAppConfig(ctx, p)
return info, err
}