You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provisionerd: log provisioner output to provisionerd log #1733
Currently we only log provisioner job output at debug level, regardless of the log level of the provisioner job log -- meaning that most users won't see it by default in the coderd output.
Instead, log the content of sdkproto.Provision_Response_Log.Log.Output to a separate logger.
This should be a separate logger to the main coderd log, and should have independent verbosity configurable via CLI flag and env var.
Part of this change could involve some handy interface between sdkproto.LogLevel and slog.Logger e.g.
type levelLogger struct {
slog.Logger
}
func (l *levelLogger) LogWithLevel(ctx context.Context, level sdkproto.LogLevel, msg string, fields ...slog.Field) {
switch level {
case sdkproto.LogLevel_DEBUG:
l.Debug(ctx, msg, fields...)
case sdkproto.LogLevel_TRACE:
l.Debug(ctx, msg, fields...)
case sdkproto.LogLevel_ERROR:
l.Error(ctx, msg, fields...)
case sdkproto.LogLevel_WARN:
l.Warn(ctx, msg, fields...)
default:
l.Info(ctx, msg, fields...)
}
}
Why do you want this feature?
In larger environments, Coder administrators may need to debug build / provision errors on behalf of users.
In these cases, it would be useful to have the logs available to administartors.
Are there any workarounds to get this functionality today?
Users would have to copy-paste the provisioner output to the Coder adminstrator, who would then need to correlate that with the coderd/provisionerd logs. This requires extra coordination and effort on behalf of both admin and user.
changed the title [-]Feat: provisionerd: log provisioner output to provisionerd log[/-][+]Provisionerd: log provisioner output to provisionerd log[/+]on Jun 7, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.
Activity
[-]Feat: provisionerd: log provisioner output to provisionerd log[/-][+]Provisionerd: log provisioner output to provisionerd log[/+]github-actions commentedon Aug 7, 2022
This issue is becoming stale. In order to keep the tracker readable and actionable, I'm going close to this issue in 7 days if there isn't more activity.