Add logging options (#154)

* Add various log options

* Remove logFormat. Add UI for log config

* Fix UI boolean flags
This commit is contained in:
WithoutPants
2019-10-25 11:13:44 +11:00
committed by Leopere
parent f29509577a
commit 564786f968
9 changed files with 197 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import (
"path/filepath"
"github.com/stashapp/stash/pkg/manager/config"
"github.com/stashapp/stash/pkg/logger"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/utils"
)
@@ -50,6 +51,18 @@ func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input models.Co
}
}
if input.LogFile != nil {
config.Set(config.LogFile, input.LogFile)
}
config.Set(config.LogOut, input.LogOut)
config.Set(config.LogAccess, input.LogAccess)
if input.LogLevel != config.GetLogLevel() {
config.Set(config.LogLevel, input.LogLevel)
logger.SetLogLevel(input.LogLevel)
}
if err := config.Write(); err != nil {
return makeConfigGeneralResult(), err
}