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

[v15] Convert TeleportProcess to use slog for logging #39398

Merged
merged 3 commits into from
Mar 28, 2024

Conversation

rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Mar 15, 2024

@rosstimothy rosstimothy added backport no-changelog Indicates that a PR does not require a changelog entry labels Mar 15, 2024
@rosstimothy rosstimothy marked this pull request as ready for review March 15, 2024 14:42
@github-actions github-actions bot requested review from kimlisa and tcsc March 15, 2024 14:42
@rosstimothy rosstimothy force-pushed the tross/backport-38551/v15 branch from 7a3cb49 to 5f2b52e Compare March 18, 2024 19:27
@rosstimothy
Copy link
Contributor Author

PTAL @tcsc

@rosstimothy rosstimothy added this pull request to the merge queue Mar 28, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 28, 2024
Begins the conversion away from logrus to slog for all messages
emitted from TeleportProcess. The logrus logger should now only
be in use for dependency injection to child components that haven't
been converted yet. There are still instances of the logrus logger
in the process configuration to emit messages, they will be converted
in a follow up PR.
…9428)

* Make slog attributes output the same content regardless of format

There were a few instances of fmt.Stringers being passed to slog
as attributes to delay their evaluation as per the performance
considerations of slog: https://pkg.go.dev/log/slog#hdr-Performance_considerations.
However, this resulted in the json handler emitting different
content since they check to see if attributes are json.Marshalers
and not fmt.Stringers. To rectify the situation, a new slog.LogValuer
implementation was added that wraps a fmt.Stringer so that attributes
can be lazily constructed while producing the same output no matter
the log output format.

* fix: wrap identity and correct typo
@rosstimothy rosstimothy force-pushed the tross/backport-38551/v15 branch 2 times, most recently from 255d190 to d319906 Compare March 28, 2024 12:51
Similar to #39315,
this updates the integrations test suite to use a regular
expression that will match output to know when the ssh_service is
ready now that Teleport is using slog instead of logrus.
@rosstimothy rosstimothy force-pushed the tross/backport-38551/v15 branch from d319906 to 076400f Compare March 28, 2024 12:58
@rosstimothy rosstimothy enabled auto-merge March 28, 2024 13:08
@rosstimothy rosstimothy added this pull request to the merge queue Mar 28, 2024
Merged via the queue into branch/v15 with commit f16d918 Mar 28, 2024
32 checks passed
@rosstimothy rosstimothy deleted the tross/backport-38551/v15 branch March 28, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants