Skip to content

Commit

Permalink
Update event logger configuration via Fleet and environment variable …
Browse files Browse the repository at this point in the history
…(container command) (#4932) (#5109)

This commit adds the ability to receive event logger output
configuration via Fleet. Previously only the log level was received
via Fleet and persisted.

Fleet can store the event logger configuration in the overrides
section from the policy, allowing users to change and persist this
configuration. The Elastic-Agent needs this configuration at startup,
so whenever the Elastic-Agent receives a new policy from Fleet, it
compares the event logging output configuration with its current one,
if it is different, it is persisted to disk and the Elastic-Agent
re-execs. When it re-starts it reads the new values from the
persistent store and applies them.

---------

Co-authored-by: Pierre HILBERT <[email protected]>
(cherry picked from commit 72c1ebd)

Co-authored-by: Tiago Queiroz <[email protected]>
  • Loading branch information
mergify[bot] and belimawr authored Jul 15, 2024
1 parent 475d247 commit ced6bc6
Show file tree
Hide file tree
Showing 11 changed files with 746 additions and 256 deletions.
20 changes: 10 additions & 10 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21730,11 +21730,11 @@ THE SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/gobuffalo/here
Version: v0.6.0
Version: v0.6.7
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/gobuffalo/[email protected].0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/gobuffalo/[email protected].7/LICENSE:

The MIT License (MIT)

Expand Down Expand Up @@ -29554,11 +29554,11 @@ SOFTWARE.

--------------------------------------------------------------------------------
Dependency : github.com/karrick/godirwalk
Version: v1.16.1
Version: v1.17.0
Licence type (autodetected): BSD-2-Clause
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/karrick/godirwalk@v1.16.1/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/karrick/godirwalk@v1.17.0/LICENSE:

BSD 2-Clause License

Expand Down Expand Up @@ -30478,11 +30478,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

--------------------------------------------------------------------------------
Dependency : github.com/markbates/pkger
Version: v0.17.0
Version: v0.17.1
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/markbates/[email protected].0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/markbates/[email protected].1/LICENSE:

The MIT License (MIT)

Expand Down Expand Up @@ -38665,11 +38665,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
Dependency : github.com/sergi/go-diff
Version: v1.2.0
Version: v1.3.1
Licence type (autodetected): MIT
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/sergi/go-diff@v1.2.0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/sergi/go-diff@v1.3.1/LICENSE:

Copyright (c) 2012-2016 The go-diff Authors. All rights reserved.

Expand Down Expand Up @@ -39511,11 +39511,11 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice

--------------------------------------------------------------------------------
Dependency : github.com/spf13/afero
Version: v1.9.5
Version: v1.10.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/spf13/afero@v1.9.5/LICENSE.txt:
Contents of probable licence file $GOMODCACHE/github.com/spf13/afero@v1.10.0/LICENSE.txt:

Apache License
Version 2.0, January 2004
Expand Down
32 changes: 32 additions & 0 deletions changelog/fragments/1719345278-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Kind can be one of:
# - breaking-change: a change to previously-documented behavior
# - deprecation: functionality that is being removed in a later release
# - bug-fix: fixes a problem in a previous version
# - enhancement: extends functionality but does not break or fix existing behavior
# - feature: new functionality
# - known-issue: problems that we are aware of in a given version
# - security: impacts on the security of a product or a user’s deployment.
# - upgrade: important information for someone upgrading from a prior version
# - other: does not fit into any of the other categories
kind: feature

# Change summary; a 80ish characters long description of the change.
summary: Event logger output now can be set via Fleet overrides or environment variable for container command.

# Long description; in case the summary is not enough to describe the change
# this field accommodate a description without length limits.
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
#description:

# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
component: elastic-agent

# PR URL; optional; the PR number that added the changeset.
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
# Please provide it if you are adding a fragment for a different PR.
pr: https://github.com/elastic/elastic-agent/pull/4932

# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
# If not present is automatically filled by the tooling with the issue linked to the PR number.
#issue:
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ require (
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-viper/mapstructure/v2 v2.0.0 // indirect
github.com/gobuffalo/here v0.6.0 // indirect
github.com/gobuffalo/here v0.6.7 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
Expand Down Expand Up @@ -192,7 +192,7 @@ require (
github.com/jcchavezs/porto v0.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/karrick/godirwalk v1.16.1 // indirect
github.com/karrick/godirwalk v1.17.0 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/knadh/koanf/maps v0.1.1 // indirect
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
Expand All @@ -203,7 +203,7 @@ require (
github.com/lightstep/go-expohisto v1.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/markbates/pkger v0.17.0 // indirect
github.com/markbates/pkger v0.17.1 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
Expand Down Expand Up @@ -246,9 +246,10 @@ require (
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rs/cors v1.11.0 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shirou/gopsutil/v4 v4.24.5 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/tilinna/clock v1.1.0 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
Expand Down
15 changes: 10 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -996,8 +996,9 @@ github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEe
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=
github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI=
github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM=
github.com/gobuffalo/here v0.6.7 h1:hpfhh+kt2y9JLDfhYUxxCRxQol540jsVfKUZzjlbp8o=
github.com/gobuffalo/here v0.6.7/go.mod h1:vuCfanjqckTuRlqAitJz6QC4ABNnS27wLb816UhsPcc=
github.com/gobuffalo/logger v1.0.6/go.mod h1:J31TBEHR1QLV2683OXTAItYIg8pv2JMHnF/quuAbMjs=
github.com/gobuffalo/packd v1.0.1/go.mod h1:PP2POP3p3RXGz7Jh6eYEf93S7vA2za6xM7QT85L4+VY=
github.com/gobuffalo/packr/v2 v2.8.3/go.mod h1:0SahksCVcx4IMnigTjiFuyldmTrdTctXsOdiU5KwbKc=
Expand Down Expand Up @@ -1338,8 +1339,9 @@ github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7 h1:oohm9Rk9JAxxmp2NLZa7Kebgz9h4+AJDcc64txg3dQ0=
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM=
github.com/karrick/godirwalk v1.15.6/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/karrick/godirwalk v1.16.1 h1:DynhcF+bztK8gooS0+NDJFrdNZjJ3gzVzC545UNA9iw=
github.com/karrick/godirwalk v1.16.1/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/karrick/godirwalk v1.17.0 h1:b4kY7nqDdioR/6qnbHQyDvmA17u5G1cZ6J+CZXwSWoI=
github.com/karrick/godirwalk v1.17.0/go.mod h1:j4mkqPuvaLI8mp1DroR3P6ad7cyYd4c1qeJ3RV7ULlk=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
Expand Down Expand Up @@ -1418,8 +1420,9 @@ github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/markbates/errx v1.1.0/go.mod h1:PLa46Oex9KNbVDZhKel8v1OT7hD5JZ2eI7AHhA0wswc=
github.com/markbates/oncer v1.0.0/go.mod h1:Z59JA581E9GP6w96jai+TGqafHPW+cPfRxz2aSZ0mcI=
github.com/markbates/pkger v0.17.0 h1:RFfyBPufP2V6cddUyyEVSHBpaAnM1WzaMNyqomeT+iY=
github.com/markbates/pkger v0.17.0/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/markbates/pkger v0.17.1 h1:/MKEtWqtc0mZvu9OinB9UzVN9iYCwLWuyUv4Bw+PCno=
github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI=
github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0=
github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
Expand Down Expand Up @@ -1846,8 +1849,9 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW
github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8=
github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I=
github.com/shirou/gopsutil/v3 v3.23.2/go.mod h1:gv0aQw33GLo3pG8SiWKiQrbDzbRY1K80RyZJ7V4Th1M=
github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI=
github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk=
Expand Down Expand Up @@ -1882,8 +1886,9 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I=
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
github.com/spf13/afero v1.9.5 h1:stMpOSZFs//0Lv29HduCmli3GUfpFoF3Y1Q/aXj/wVM=
github.com/spf13/afero v1.9.5/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type PolicyChangeHandler struct {
ch chan coordinator.ConfigChange
setters []actions.ClientSetter
policyLogLevelSetter logLevelSetter
coordinator *coordinator.Coordinator
// Disabled for 8.8.0 release in order to limit the surface
// https://github.com/elastic/security-team/issues/6501
// // Last known valid signature validation key
Expand All @@ -60,6 +61,7 @@ func NewPolicyChangeHandler(
store storage.Store,
ch chan coordinator.ConfigChange,
policyLogLevelSetter logLevelSetter,
coordinator *coordinator.Coordinator,
setters ...actions.ClientSetter,
) *PolicyChangeHandler {
return &PolicyChangeHandler{
Expand All @@ -69,6 +71,7 @@ func NewPolicyChangeHandler(
store: store,
ch: ch,
setters: setters,
coordinator: coordinator,
policyLogLevelSetter: policyLogLevelSetter,
}
}
Expand Down Expand Up @@ -305,6 +308,15 @@ func (h *PolicyChangeHandler) handlePolicyChange(ctx context.Context, c *config.
h.config.Fleet.Client = *validatedConfig
}

cfg, err := configuration.NewFromConfig(c)
if err != nil {
return errors.New(err, "could not parse the configuration from the policy", errors.TypeConfig)
}
hasEventLoggingOutputChanged := h.hasEventLoggingOutputChanged(cfg)
if hasEventLoggingOutputChanged {
h.config.Settings.EventLoggingConfig = cfg.Settings.EventLoggingConfig
}

// persist configuration
err = saveConfig(h.agentInfo, h.config, h.store)
if err != nil {
Expand All @@ -317,9 +329,30 @@ func (h *PolicyChangeHandler) handlePolicyChange(ctx context.Context, c *config.
return fmt.Errorf("applying FleetClientConfig: %w", err)
}

// If the event logging output has changed, we need to
// re-exec the Elastic-Agent to apply the new logging
// output.
// The new logging configuration has already been persisted
// to the disk, the Elastic-Agent will pick it up once it starts.
if hasEventLoggingOutputChanged {
h.coordinator.ReExec(nil)
}

return nil
}

// hasEventLoggingOutputChanged returns true if the output of the event logger has changed
func (p *PolicyChangeHandler) hasEventLoggingOutputChanged(new *configuration.Configuration) bool {
switch {
case p.config.Settings.EventLoggingConfig.ToFiles != new.Settings.EventLoggingConfig.ToFiles:
return true
case p.config.Settings.EventLoggingConfig.ToStderr != new.Settings.EventLoggingConfig.ToStderr:
return true
default:
return false
}
}

func validateLoggingConfig(cfg *config.Config) (*logger.Config, error) {

parsedConfig, err := configuration.NewPartialFromConfigNoDefaults(cfg)
Expand Down Expand Up @@ -445,12 +478,14 @@ func clientEqual(k1 remote.Config, k2 remote.Config) bool {
func fleetToReader(agentID string, headers map[string]string, cfg *configuration.Configuration) (io.Reader, error) {
configToStore := map[string]interface{}{
"fleet": cfg.Fleet,
"agent": map[string]interface{}{
"id": agentID,
"headers": headers,
"logging.level": cfg.Settings.LoggingConfig.Level,
"monitoring.http": cfg.Settings.MonitoringConfig.HTTP,
"monitoring.pprof": cfg.Settings.MonitoringConfig.Pprof,
"agent": map[string]interface{}{ // Add event logging configuration here!
"id": agentID,
"headers": headers,
"logging.level": cfg.Settings.LoggingConfig.Level,
"logging.event_data.to_files": cfg.Settings.EventLoggingConfig.ToFiles,
"logging.event_data.to_stderr": cfg.Settings.EventLoggingConfig.ToStderr,
"monitoring.http": cfg.Settings.MonitoringConfig.HTTP,
"monitoring.pprof": cfg.Settings.MonitoringConfig.Pprof,
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ func TestPolicyChange(t *testing.T) {
}

cfg := configuration.DefaultConfiguration()

handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t))
handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t), &coordinator.Coordinator{})

err := handler.Handle(context.Background(), action, ack)
require.NoError(t, err)
Expand Down Expand Up @@ -94,7 +93,7 @@ func TestPolicyAcked(t *testing.T) {
}

cfg := configuration.DefaultConfiguration()
handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t))
handler := NewPolicyChangeHandler(log, agentInfo, cfg, nullStore, ch, nilLogLevelSet(t), &coordinator.Coordinator{})

err := handler.Handle(context.Background(), action, tacker)
require.NoError(t, err)
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/agent/application/managed_mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ func (m *managedConfigManager) initDispatcher(canceller context.CancelFunc) *han
m.store,
m.ch,
settingsHandler,
m.coord,
)

m.dispatcher.MustRegister(
Expand Down
16 changes: 16 additions & 0 deletions internal/pkg/agent/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"gopkg.in/yaml.v2"

"github.com/elastic/elastic-agent-libs/kibana"
"github.com/elastic/elastic-agent-libs/logp"
"github.com/elastic/elastic-agent-libs/transport/httpcommon"
"github.com/elastic/elastic-agent-libs/transport/tlscommon"
"github.com/elastic/elastic-agent/internal/pkg/agent/application/paths"
Expand Down Expand Up @@ -136,6 +137,11 @@ be used when the same credentials will be used across all the possible actions a
ELASTIC_AGENT_TAGS - user provided tags for the agent [linux,staging]
* Elastic-Agent event logging
If EVENTS_TO_STDERR is set to true log entries containing event data or whole raw events will be logged to stderr alongside
all other log entries. If unset or set to false, the events will be logged to a separate file that is not collected alongside
the monitoring logs, however they will be present in diagnostics.
By default when this command starts it will check for an existing fleet.yml. If that file already exists then
all the above actions will be skipped, because the Elastic Agent has already been enrolled. To ensure that enrollment
occurs on every start of the container set FLEET_FORCE to 1.
Expand Down Expand Up @@ -769,6 +775,16 @@ func logToStderr(cfg *configuration.Configuration) {
cfg.Settings.LoggingConfig.ToStderr = true
cfg.Settings.LoggingConfig.ToFiles = false
}

eventsToStderrEnv := envWithDefault("false", "EVENTS_TO_STDERR")
eventsToStderr, err := strconv.ParseBool(eventsToStderrEnv)
if err != nil {
logp.Warn("cannot parse EVENS_TO_STDERR='%s' as boolean, logging events to file'", eventsToStderrEnv)
}
if eventsToStderr {
cfg.Settings.EventLoggingConfig.ToFiles = false
cfg.Settings.EventLoggingConfig.ToStderr = true
}
}

func setPaths(statePath, configPath, logsPath, socketPath string, writePaths bool) error {
Expand Down
Loading

0 comments on commit ced6bc6

Please sign in to comment.