diff --git a/cmd/tailscaled/tailscaled_windows.go b/cmd/tailscaled/tailscaled_windows.go index a6c9f8c04..037712dbf 100644 --- a/cmd/tailscaled/tailscaled_windows.go +++ b/cmd/tailscaled/tailscaled_windows.go @@ -78,7 +78,10 @@ func (service *ipnService) Execute(args []string, r <-chan svc.ChangeRequest, ch // Make a logger without a date prefix, as filelogger // and logtail both already add their own. All we really want // from the log package is the automatic newline. - logger := log.New(os.Stderr, "", 0) + // We start with log.Default().Writer(), which is the logtail + // writer that logpolicy already installed as the global + // output. + logger := log.New(log.Default().Writer(), "", 0) ipnserver.BabysitProc(ctx, args, logger.Printf) }() @@ -114,6 +117,9 @@ func beWindowsSubprocess() bool { } logid := os.Args[2] + // Remove the date/time prefix; the logtail + file logggers add it. + log.SetFlags(0) + log.Printf("Program starting: v%v: %#v", version.Long, os.Args) log.Printf("subproc mode: logid=%v", logid)