summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/syncthing/st.go5
-rw-r--r--lib/webserver/server.go8
-rw-r--r--lib/xdsconfig/config.go8
3 files changed, 13 insertions, 8 deletions
diff --git a/lib/syncthing/st.go b/lib/syncthing/st.go
index 10210a4..b622970 100644
--- a/lib/syncthing/st.go
+++ b/lib/syncthing/st.go
@@ -317,7 +317,10 @@ func (s *SyncThing) Connect() error {
return fmt.Errorf("ERROR: cannot connect to Syncthing (null client)")
}
- s.client.SetLogger(s.log)
+ // Redirect HTTP log into a file
+ s.client.SetLogLevel(s.conf.Log.Level.String())
+ s.client.LoggerPrefix = "SYNCTHING: "
+ s.client.LoggerOut = s.conf.LogVerboseOut
s.MyID, err = s.IDGet()
if err != nil {
diff --git a/lib/webserver/server.go b/lib/webserver/server.go
index 5183208..8639b66 100644
--- a/lib/webserver/server.go
+++ b/lib/webserver/server.go
@@ -46,10 +46,10 @@ func New(cfg *xdsconfig.Config, mfolders *model.Folders, sdks *crosssdk.SDKs, lo
gin.SetMode(gin.ReleaseMode)
}
- // Redirect gin logs into logrus logger
- gin.DefaultWriter = logr.Out
- gin.DefaultErrorWriter = logr.Out
- log.SetOutput(logr.Out)
+ // Redirect gin logs into another logger (LogVerboseOut may be stderr or a file)
+ gin.DefaultWriter = cfg.LogVerboseOut
+ gin.DefaultErrorWriter = cfg.LogVerboseOut
+ log.SetOutput(cfg.LogVerboseOut)
// FIXME - fix pb about isTerminal=false when out is in VSC Debug Console
diff --git a/lib/xdsconfig/config.go b/lib/xdsconfig/config.go
index a3e5a7e..82ca97f 100644
--- a/lib/xdsconfig/config.go
+++ b/lib/xdsconfig/config.go
@@ -2,6 +2,7 @@ package xdsconfig
import (
"fmt"
+ "io"
"os"
"github.com/Sirupsen/logrus"
@@ -17,9 +18,10 @@ type Config struct {
Builder BuilderConfig `json:"builder"`
// Private (un-exported fields in REST GET /config route)
- Options Options `json:"-"`
- FileConf FileConfig `json:"-"`
- Log *logrus.Logger `json:"-"`
+ Options Options `json:"-"`
+ FileConf FileConfig `json:"-"`
+ Log *logrus.Logger `json:"-"`
+ LogVerboseOut io.Writer `json:"-"`
}
// Options set at the command line