Compare commits

...

4 Commits

Author SHA1 Message Date
Christine Dodrill
a6a834b5fe logpolicy: shorten envvar name
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-03 15:10:16 -05:00
Christine Dodrill
8ec50db8ef logtail: remove this debugging printf
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-03 12:26:23 -05:00
Christine Dodrill
305ae4d8ad log{policy,tail}: set the target correctly
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-03 12:25:24 -05:00
Christine Dodrill
187fc6f1c5 logpolicy: set log target using an environment variable
Signed-off-by: Christine Dodrill <xe@tailscale.com>
2021-02-03 11:42:01 -05:00

View File

@@ -17,6 +17,7 @@ import (
"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