Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EnableLoggingToFile function on Windows #31882

Merged
merged 3 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions cmd/agent/common/common_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import (
"github.com/DataDog/datadog-agent/pkg/util/log"
"github.com/DataDog/datadog-agent/pkg/util/winutil"
"github.com/DataDog/datadog-agent/pkg/util/winutil/messagestrings"

"github.com/cihub/seelog"
)

// ServiceName is the name of the Windows Service the agent runs as
Expand All @@ -28,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
Loading