cool-easter-32542
09/16/2023, 12:01 PM./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:
• Make the pantsd logs pid-indexed, similar to the exception logs. So, per each folder, there would be:
• A master pantsd.log file, which would have all the logs of pantsd up to that point.
• One pantsd.<pid>.log file per daemon that was started in with that directory.
Tradeoffs
• This means that we will have potentially spread out logs, and different logfiles might have different contents. For instance, imagine this series of invocations:
$ ./pants --enable-pantsd --daemon-log-locations=['/tmp/a'] goals
$ ./pants --enable-pantsd --daemon-log-locations=['/tmp/a', '/tmp/b'] goals
$ ./pants --enable-pantsd --daemon-log-locations=['/tmp/b'] goals
This could be a bit confusing.
pantsbuild/pantscool-easter-32542
09/16/2023, 12:01 PM