suport for onlyoffice

This commit is contained in:
A.Unger
2021-03-17 15:36:37 +01:00
parent e15e33d873
commit bf63bc8c7c
3 changed files with 9 additions and 0 deletions

View File

@@ -64,6 +64,7 @@ func NewLogger(cfg *config.Config) log.Logger {
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
)
}
@@ -122,6 +123,7 @@ func NewSutureService(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 {
cfg.Onlyoffice.Supervised = true
}
cfg.Onlyoffice.Log.File = cfg.Log.File
return SutureService{
cfg: cfg.Onlyoffice,
}

View File

@@ -7,6 +7,7 @@ type Log struct {
Level string
Pretty bool
Color bool
File string
}
// Debug defines the available debug configuration.

View File

@@ -53,6 +53,12 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
// ServerWithConfig applies cfg to the root flagset
func ServerWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{
&cli.StringFlag{
Name: "log-file",
Usage: "Enable log to file",
EnvVars: []string{"ONLYOFFICE_LOG_FILE", "OCIS_LOG_FILE"},
Destination: &cfg.Log.File,
},
&cli.BoolFlag{
Name: "tracing-enabled",
Usage: "Enable sending traces",