-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Specify log directory path of structured logs #16696
Copy link
Copy link
Open
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-build-analysisNightly: build-analysisNightly: build-analysis
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Z-build-analysisNightly: build-analysisNightly: build-analysis
Type
Fields
Give feedbackNo fields configured for issues without a type.
Problem
Currently, when
-Zbuild-analysisis enabled, Cargo writes log files, to~/.cargo/logdirectly. This is good enough for a prototype but not ideal for stabilization.We would like to have a way to configure the location of log files, and perhaps also have a way to write to stdout. Here are some use cases:
CARGO_HOME. For example, crater runs Rust crates in a Docker container whereCARGO_HOMEis mounted as read-only.--message-format=jsonwith session ID from-Zbuild-analysis#16576)CARGO_HOMEentirely.Proposed Solution
The easiest way to implement it is adding a config file to specify log directory location to the
[build.analysis]table. For example,However, we have discussed that the structured logging might be more general that build analysis, and might be renamed to the
[log]table. The field namelog-pathfeels redundant when underlogtable. (Another issue of using[log]table is that it might conflict withCARGO_LOGenv var, though that is a bit out of scope here).We also need to consider if we want to support streaming to stdout, for example, a special
-to stream to stdout.Notes
No response