mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
Add an environment variable to enable customizing the log target (#1243)
Signed-off-by: Christine Dodrill <xe@tailscale.com>
This commit is contained in:
parent
45fe06a89f
commit
81466eef81
@ -17,6 +17,7 @@
|
|||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -387,6 +388,13 @@ func New(collection string) *Policy {
|
|||||||
HTTPC: &http.Client{Transport: newLogtailTransport(logtail.DefaultHost)},
|
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{})
|
filchBuf, filchErr := filch.New(filepath.Join(dir, cmdName), filch.Options{})
|
||||||
if filchBuf != nil {
|
if filchBuf != nil {
|
||||||
c.Buffer = filchBuf
|
c.Buffer = filchBuf
|
||||||
|
Loading…
Reference in New Issue
Block a user