Add an environment variable to enable customizing the log target
"log"
"net"
"net/http"
+ "net/url"
"os"
"os/exec"
"path/filepath"
@@ -387,6 +388,13 @@ func New(collection string) *Policy {
HTTPC: &http.Client{Transport: newLogtailTransport(logtail.DefaultHost)},
}
+ if val, ok := os.LookupEnv("TAILSCALE_LOG_TARGET"); 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{})
if filchBuf != nil {
c.Buffer = filchBuf
