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

chore: Set default log file to empty string #28

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 1 addition & 4 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
},
Expand All @@ -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,
},
Expand All @@ -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",
Expand Down
Loading