Skip to content

update tracing log format, remove unnessary rustwide log fields - #3498

Merged
syphar merged 1 commit into
rust-lang:mainfrom
syphar:simpl-log
Sep 7, 2026
Merged

update tracing log format, remove unnessary rustwide log fields#3498
syphar merged 1 commit into
rust-lang:mainfrom
syphar:simpl-log

Conversation

@syphar

@syphar syphar commented Sep 3, 2026

Copy link
Copy Markdown
Member
  • our internal Pretty format used the tracing-subscriber Full format, which is quite noisy.
  • I now added support for all log-formats that tracing-subscriber supports by default.
  • for local cli usage, compact will be the default, which puts the msg/span fields at the end
  • the default for the log-format is now determined by is_terminal or not. So we can drop the explicit setting on our server, and will have nicers logs in docs_rs_admin, or other CLI calls.
  • rustwide build logs came via tracing_log::LogTracer, which appended 4 additional fields to each line. We don't need most of these, so I added a custom adapter that will just emit the log-message and target to tracing, and drop the rest. This only affects tests, local CLI / dev usage, etc. On our production build-servers, the log-tracer was disabled anyways, since we don't emit the build logs, just capture and upload them. But: this will be much more interesting when the build-cli for CI makes progress, so the output is actually usable.

next steps after this

  • reduce the level from INFO to DEBUG for some spans (for example internal function calls in rustwide)
  • remove all fields from spans (via instrument(skip_all)), only add back what we really want to see in the logs, and never use the debug representation of structs in logs.
  • move some fields from spans to events, so they get logged once, and not again in all child-method-calls.

tracing log format

With an active build{crate=example} span, the previous full formatter
repeated the span fields before each bridged message:

2026-09-03T12:00:00Z  INFO build{crate=example}: log: Compiling example

The compact formatter keeps the span name before the message and appends
the span fields after it:

2026-09-03T12:00:00Z  INFO build: log: Compiling example crate=example

@syphar syphar self-assigned this Sep 3, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Sep 3, 2026
@syphar
syphar marked this pull request as ready for review September 3, 2026 17:28
@syphar
syphar requested a review from a team as a code owner September 3, 2026 17:28
@syphar

This comment has been minimized.

@rustbot rustbot assigned GuillaumeGomez and unassigned syphar Sep 3, 2026
@syphar

syphar commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Damn, some compile errors / test errors.

Will fix them tomorrow or later or next week, then ping you again

@syphar syphar assigned syphar and unassigned GuillaumeGomez Sep 3, 2026
@syphar
syphar force-pushed the simpl-log branch 2 times, most recently from d1b35cd to beebb75 Compare September 4, 2026 07:11
@syphar
syphar marked this pull request as draft September 4, 2026 08:30
@syphar
syphar marked this pull request as ready for review September 7, 2026 09:39
@syphar

syphar commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

r? @GuillaumeGomez

@rustbot rustbot assigned GuillaumeGomez and unassigned syphar Sep 7, 2026
@syphar
syphar merged commit a5a3daf into rust-lang:main Sep 7, 2026
10 checks passed
@syphar
syphar deleted the simpl-log branch September 7, 2026 09:42
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants