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

Store logs to a file #23

Open
pditommaso opened this issue Nov 9, 2021 · 5 comments
Open

Store logs to a file #23

pditommaso opened this issue Nov 9, 2021 · 5 comments
Milestone

Comments

@pditommaso
Copy link
Collaborator

Being an application meant to be executed in the background, it would make sense to redirect application logs to a file .tw-agent.log and render to console only logs with level >= INFO.

@pditommaso
Copy link
Collaborator Author

Related to this, it would be better to not log execution commands that can contain encoded variables, for example:

15:52:20.794 [default-nioEventLoopGroup-1-3] INFO  io.seqera.tower.agent.Agent - Execute: mkdir -p /home/ubuntu/work; 
cd /home/ubuntu/work;
echo IyEvYmluL2Jhc2gKI1NCQVRDSCAtRCAvaG9tZS91YnVudHUvd29yawojU0JBVENIIC1KIG5mLXdvcmtmbG93LVFHTmFiSlB5UFg0QVEKI1NCQVRDSCAtbyAvaG9tZS91YnVudHUvd29yay9uZi1RR05hYkpQeVBYNEFRLmxvZwojU0JBVENIIC0tbm8tcmVxdWV1ZQojU0JBVENIIC1wIGxvbmcKc2V0IC1lCnNldCAtbyBwaXBlZmFpbAoKIyBJbnB1dCB2YXJpYWJsZXM6CiMKIyAtIE5YRl9VVUlEOiBuZXh0ZmxvdyBzZXNzaW9uIGlkIGdlbmVyYXRlZCBieSB0b3dlcgojIC0gTlh.. etc

Ideally this should only be logged when TRACE level is enabled not default (debug) logging

@jordeu jordeu added this to the v0.3 milestone Nov 25, 2021
@jordeu jordeu modified the milestones: v0.3, v0.4 Dec 3, 2021
@jordeu jordeu mentioned this issue Dec 13, 2021
@jordeu
Copy link
Member

jordeu commented Dec 13, 2021

To log to a file causes this error when building the GraalVM static image: micronaut-projects/micronaut-core#3683

It seems that there is a workaround that may be valid for our use case. Even though, I'm moving this issue to the next Agent release v0.5 because this requires further testing.

The part of removing sensitive data it is implemented on v0.4

@pditommaso
Copy link
Collaborator Author

Try with log4j 😄

@pditommaso
Copy link
Collaborator Author

pditommaso commented Dec 13, 2021

however the most important thing here is to make it less verbose. can you at least not dump executed command and result to console, maybe just changing log.debug to log.trace level?

@jordeu
Copy link
Member

jordeu commented Dec 13, 2021

however the most important thing here is to make it less verbose. can you at least not dump executed command and result to console, maybe just changing log.debug to log.trace level?

I'm doing this part. See #32

@jordeu jordeu closed this as completed in 4f49431 Dec 13, 2021
@jordeu jordeu reopened this Dec 13, 2021
@jordeu jordeu modified the milestones: v0.5, v0.6 Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants