From b5f733a9e73cf7729d517e9cb2df76558c43a3cf Mon Sep 17 00:00:00 2001 From: Jamie Sinn Date: Fri, 4 Oct 2024 12:44:15 -0400 Subject: [PATCH 1/4] Set default log file to empty string --- options.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/options.go b/options.go index 8dcc92e..186eddd 100644 --- a/options.go +++ b/options.go @@ -34,7 +34,7 @@ type ProxyInstance struct { SSEEnabled bool `json:"sseEnabled" envconfig:"SSE_ENABLED" default:"false" desc:"Whether to enable the SSE server. Requires setting sseHostname param too. Defaults to false."` SSEHostname string `json:"sseHostname" envconfig:"SSE_HOSTNAME" desc:"The hostname to provide to clients to connect to for SSE requests. This must be reachable from the clients and can be either a DNS hostname or a raw IP address."` SDKKey string `json:"sdkKey" required:"true" envconfig:"SDK_KEY" desc:"The Server SDK key to use for this instance."` - LogFile string `json:"logFile" default:"/var/log/devcycle.log" envconfig:"LOG_FILE" desc:"The path to the log file. Defaults to /var/log/devcycle.log"` + LogFile string `json:"logFile" default:"" envconfig:"LOG_FILE" desc:"The path to the log file."` PlatformData devcycle.PlatformData `json:"platformData" required:"true"` SDKConfig SDKConfig `json:"sdkConfig" required:"true"` dvcClient *devcycle.Client @@ -130,9 +130,6 @@ func (i *ProxyInstance) Default() { if i.HTTPEnabled && i.HTTPPort == 0 { i.HTTPPort = 8080 } - if i.LogFile == "" { - i.LogFile = "/var/log/devcycle.log" - } if i.UnixSocketEnabled { if i.UnixSocketPath == "" { i.UnixSocketPath = "/tmp/devcycle.sock" From 3490dd649dcbff431a6768d6252ebbbf4ca8e64f Mon Sep 17 00:00:00 2001 From: Jamie Sinn Date: Fri, 4 Oct 2024 12:48:44 -0400 Subject: [PATCH 2/4] update tests --- options_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/options_test.go b/options_test.go index 8151501..5749c65 100644 --- a/options_test.go +++ b/options_test.go @@ -41,7 +41,7 @@ func TestParseConfig(t *testing.T) { UnixSocketEnabled: false, HTTPEnabled: true, SDKKey: "dvc-test-key", - LogFile: "/var/log/devcycle.log", + LogFile: "", PlatformData: api.PlatformData{}, SDKConfig: SDKConfig{}, }, @@ -82,7 +82,7 @@ func TestParseConfig(t *testing.T) { UnixSocketPermissions: "0755", HTTPEnabled: false, SDKKey: "dvc-test-key", - LogFile: "/var/log/devcycle.log", + LogFile: "", PlatformData: api.PlatformData{ SdkType: "sdk type", SdkVersion: "v1.2.3", From 3eaf4458e65c764a7f07e9de6fef47e1af5c6f38 Mon Sep 17 00:00:00 2001 From: Jamie Sinn Date: Fri, 4 Oct 2024 12:49:16 -0400 Subject: [PATCH 3/4] update tests --- options_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/options_test.go b/options_test.go index 5749c65..cb9f3d3 100644 --- a/options_test.go +++ b/options_test.go @@ -124,7 +124,7 @@ func TestParseConfig(t *testing.T) { UnixSocketEnabled: false, HTTPEnabled: false, SDKKey: "dvc-sample-key", - LogFile: "/var/log/devcycle.log", + LogFile: "", PlatformData: api.PlatformData{}, SDKConfig: defaultSDKConfig, }, @@ -144,7 +144,7 @@ func TestParseConfig(t *testing.T) { UnixSocketEnabled: false, HTTPEnabled: false, SDKKey: "dvc-sample-key", - LogFile: "/var/log/devcycle.log", + LogFile: "", PlatformData: api.PlatformData{}, SDKConfig: defaultSDKConfig, }, @@ -163,7 +163,7 @@ func TestParseConfig(t *testing.T) { UnixSocketEnabled: false, HTTPEnabled: true, SDKKey: "dvc_YOUR_KEY_HERE", - LogFile: "/var/log/devcycle.log", + LogFile: "", SSEEnabled: false, PlatformData: api.PlatformData{ SdkType: "server", From e1123e9752e7be3e011d2703a17a293720bfe98f Mon Sep 17 00:00:00 2001 From: Jamie Sinn Date: Fri, 4 Oct 2024 13:19:39 -0400 Subject: [PATCH 4/4] remove from example config --- config.json.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json.example b/config.json.example index 724bf71..9d6dd6b 100644 --- a/config.json.example +++ b/config.json.example @@ -6,7 +6,7 @@ "unixSocketEnabled": false, "httpEnabled": true, "sdkKey": "dvc_YOUR_KEY_HERE", - "logFile": "/var/log/devcycle.log", + "logFile": "", "platformData": { "sdkType": "server", "sdkVersion": "2.10.2",