diff --git a/logpolicy/logpolicy.go b/logpolicy/logpolicy.go index 12032e022..add1874a6 100644 --- a/logpolicy/logpolicy.go +++ b/logpolicy/logpolicy.go @@ -339,6 +339,18 @@ func New(collection string) *Policy { tryFixLogStateLocation(dir, cmdName) cfgPath := filepath.Join(dir, fmt.Sprintf("%s.log.conf", cmdName)) + + // The Windows service previously ran as tailscale-ipn.exe, so + // let's keep using that log base name if it exists. + if runtime.GOOS == "windows" && cmdName == "tailscaled" { + const oldCmdName = "tailscale-ipn" + oldPath := filepath.Join(dir, oldCmdName+".log.conf") + if fi, err := os.Stat(oldPath); err == nil && fi.Mode().IsRegular() { + cfgPath = oldPath + cmdName = oldCmdName + } + } + var oldc *Config data, err := ioutil.ReadFile(cfgPath) if err != nil {