Skip to content

Commit

Permalink
Remove EnableLoggingToFile function on Windows (#31882)
Browse files Browse the repository at this point in the history
  • Loading branch information
pgimalac authored Dec 13, 2024
1 parent 31ab349 commit 3b788c9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
15 changes: 0 additions & 15 deletions cmd/agent/common/common_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import (
"os"
"path/filepath"

//nolint:depguard // creating a logger from a seelog config
"github.com/cihub/seelog"

pkgconfigsetup "github.com/DataDog/datadog-agent/pkg/config/setup"
"github.com/DataDog/datadog-agent/pkg/util/defaultpaths"
"github.com/DataDog/datadog-agent/pkg/util/log"
Expand All @@ -29,18 +26,6 @@ func init() {
}
}

// EnableLoggingToFile -- set up logging to file
func EnableLoggingToFile() {
seeConfig := `
<seelog>
<outputs>
<rollingfile type="size" filename="c:\\ProgramData\\DataDog\\Logs\\agent.log" maxsize="1000000" maxrolls="2" />
</outputs>
</seelog>`
logger, _ := seelog.LoggerFromConfigAsBytes([]byte(seeConfig))
log.ReplaceLogger(logger)
}

// CheckAndUpgradeConfig checks to see if there's an old datadog.conf, and if
// datadog.yaml is either missing or incomplete (no API key). If so, upgrade it
func CheckAndUpgradeConfig() error {
Expand Down
2 changes: 0 additions & 2 deletions cmd/agent/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"os"

"github.com/DataDog/datadog-agent/cmd/agent/command"
"github.com/DataDog/datadog-agent/cmd/agent/common"
"github.com/DataDog/datadog-agent/cmd/agent/subcommands"
"github.com/DataDog/datadog-agent/cmd/agent/windows/service"
"github.com/DataDog/datadog-agent/cmd/internal/runcmd"
Expand All @@ -20,7 +19,6 @@ import (
)

func main() {
common.EnableLoggingToFile()
// if command line arguments are supplied, even in a non interactive session,
// then just execute that. Used when the service is executing the executable,
// for instance to trigger a restart.
Expand Down
2 changes: 0 additions & 2 deletions cmd/iot-agent/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"os"

"github.com/DataDog/datadog-agent/cmd/agent/command"
"github.com/DataDog/datadog-agent/cmd/agent/common"
"github.com/DataDog/datadog-agent/cmd/agent/subcommands"
"github.com/DataDog/datadog-agent/cmd/agent/windows/service"
"github.com/DataDog/datadog-agent/pkg/util/flavor"
Expand All @@ -24,7 +23,6 @@ func main() {
// set the Agent flavor
flavor.SetFlavor(flavor.IotAgent)

common.EnableLoggingToFile()
// if command line arguments are supplied, even in a non interactive session,
// then just execute that. Used when the service is executing the executable,
// for instance to trigger a restart.
Expand Down

0 comments on commit 3b788c9

Please sign in to comment.