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

[elastic-agent]: ensure that the enroll command also logs to file if configured #24897

Closed
simitt opened this issue Apr 1, 2021 · 2 comments · Fixed by #25150
Closed

[elastic-agent]: ensure that the enroll command also logs to file if configured #24897

simitt opened this issue Apr 1, 2021 · 2 comments · Fixed by #25150
Assignees
Labels
bug Team:Elastic-Agent Label for the Agent team v7.13.0

Comments

@simitt
Copy link
Contributor

simitt commented Apr 1, 2021

The enroll command can be automatically triggered when starting the docker container. In which case the LOGS_PATH should be respected.

Code path that needs to be changed:
https:/elastic/beats/blob/master/x-pack/elastic-agent/pkg/agent/cmd/enroll.go#L197-L200

@simitt simitt added bug Team:Elastic-Agent Label for the Agent team labels Apr 1, 2021
@blakerouse
Copy link
Contributor

This is because of this change here: #24466

I think the change is correct, I would not expect the enroll command by default to write to a log file. We could change the container subcommand when it spawns the enroll command to send the stdout and stderr to a file when LOGS_PATH is set.

Actually with LOGS_PATH set I would expect all output from the container command to go to a log file. So we could set that up so it writes both to stdout and to a logfile. The logfile would need to be seperate from the main elastic-agent.log as they should not collide. Maybe elastic-agent-startup.log?

@simitt
Copy link
Contributor Author

simitt commented Apr 1, 2021

That sounds very reasonable to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Elastic-Agent Label for the Agent team v7.13.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants