-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
[pantsd] Persist logs outside of the workdir #8196
Comments
My feeling is that this might conflate two issues:
The first thing is covered in #8128 (which this ticket seems to be closest to). The second thing is covered by #7810. AFAICT, those issues don't need to be related at all... it's possible that the reason I think this is because you mention an environment variable above... but if the flag is daemon-invalidating, then there is no need to send it across as an env var, because the daemon will restart if it is changed. One other thing to watch out for here: directly using locations like |
I had totally forgotten about #8128. This issue is intended to be a duplicate of that. I definitely just want to solve problem number 1 here.
How about putting them in a subdirectory, which is the hashed buildroot? So, for
An alternative would be to not hash the buildroot, and do something like I'm slightly weary of making exceptions in clean-all, and pretty unconfident in making changes to what pants stores in the buildroot. Of the options you proposed, I think I'd go with special-casing clean-all, seems like a minor change.
Whatever direction we take this in, I love this idea. |
As mentioned on #2857, it might be good for all runtracker state to be able to be relocated. That also potentially relates to |
Closing since |
Problem
When users have issues with the pants daemon, the first recommendation is to gather the logs (pantsd.log, exceptions.log...), because that's the best way to diagnose issues.
However, the first instinct of many users when something goes wrong with pants is to run
./pants clean-all
and try again, which means that the logs get deleted before we can get them.Solution
Pass an optional, daemon-invalidating flag, that is a list of locations where the daemon should log things. This would be passed via env-var to the daemon at startup, here.
Then, we should modify the LOGGER in the
logging
crate, so that it accepts multiple streams of output for the pantsd log. We should output the log directory very obviously whenever we throw an error on the client side.Follow-ups
Some enhancements that can also be done as part of this or separately:
pantsd.log
file, which would have all the logs of pantsd up to that point.pantsd.<pid>.log
file per daemon that was started in with that directory.Tradeoffs
This could be a bit confusing.
The text was updated successfully, but these errors were encountered: