diff --git a/logpolicy/logpolicy.go b/logpolicy/logpolicy.go index d879d0600..4103b43c1 100644 --- a/logpolicy/logpolicy.go +++ b/logpolicy/logpolicy.go @@ -17,6 +17,7 @@ import ( "log" "net" "net/http" + "net/url" "os" "os/exec" "path/filepath" @@ -390,6 +391,8 @@ func New(collection string) *Policy { if val, ok := os.LookupEnv("TAILSCALE_LOG_TARGET_DO_NOT_SET_UNLESS_TOLD_TO"); ok { log.Println("You have enabled a non-default log target. Doing without being told to by Tailscale staff or your network administrator will make getting support difficult.") c.BaseURL = val + u, _ := url.Parse(val) + c.HTTPC = &http.Client{Transport: newLogtailTransport(u.Host)} } filchBuf, filchErr := filch.New(filepath.Join(dir, cmdName), filch.Options{}) diff --git a/logtail/logtail.go b/logtail/logtail.go index bad60d011..788ff98f5 100644 --- a/logtail/logtail.go +++ b/logtail/logtail.go @@ -12,6 +12,7 @@ import ( "fmt" "io" "io/ioutil" + "log" "net/http" "os" "strconv" @@ -51,6 +52,7 @@ type Config struct { func NewLogger(cfg Config, logf tslogger.Logf) *Logger { if cfg.BaseURL == "" { cfg.BaseURL = "https://" + DefaultHost + log.Println("XXX(Xe): set default host") } if cfg.HTTPC == nil { cfg.HTTPC = http.DefaultClient