diff --git a/cmd/gotenberg.go b/cmd/gotenberg.go index 94e15672..a560082e 100644 --- a/cmd/gotenberg.go +++ b/cmd/gotenberg.go @@ -36,9 +36,9 @@ func Run() { // Logging & telemetry flags. fs.String("log-level", gotenberg.InfoLoggingLevel, "Set the log level") fs.String("log-fields-prefix", "", "Prepend a specified prefix to each log field key") - fs.String("log-std-format", gotenberg.AutoLoggingFormat, "Set the log format for standard output") + fs.String("log-std-format", gotenberg.AutoLoggingFormat, "Set the format of the logs Gotenberg writes to standard error") fs.Bool("log-std-enable-gcp-fields", false, "Use GCP-compatible field names in log output") - fs.String("log-std-level-case", gotenberg.LowerLevelCase, "Set the case of the level field in the standard output, either lower or upper") + fs.String("log-std-level-case", gotenberg.LowerLevelCase, "Set the case of the level field in the logs Gotenberg writes to standard error, either lower or upper") descriptors := gotenberg.GetModuleDescriptors() for _, desc := range descriptors { diff --git a/pkg/gotenberg/internal/log/stdhandler.go b/pkg/gotenberg/internal/log/stdhandler.go index e48c314e..d801f379 100644 --- a/pkg/gotenberg/internal/log/stdhandler.go +++ b/pkg/gotenberg/internal/log/stdhandler.go @@ -18,7 +18,7 @@ const ( ) // traceContextHandler is an internal wrapper that specifically injects -// trace_id and span_id into the log record before they are written to the standard output. +// trace_id and span_id into the log record before they are written to the standard error. type traceContextHandler struct { slog.Handler } @@ -51,11 +51,11 @@ func (h traceContextHandler) WithGroup(name string) slog.Handler { } // upperLevelCase is the value of the level-case setting that keeps the level -// field uppercase in the standard output. It mirrors gotenberg.UpperLevelCase, +// field uppercase in the standard error. It mirrors gotenberg.UpperLevelCase, // duplicated here because the internal log package cannot import gotenberg. const upperLevelCase = "upper" -// NewStdHandler returns a [slog.Handler] instance for the standard output. +// NewStdHandler returns a [slog.Handler] instance that writes to the standard error. func NewStdHandler(level slog.Level, format string, fieldsPrefix string, enableGcpFields bool, levelCase string) (slog.Handler, error) { // #nosec: G115 isTerminal := term.IsTerminal(int(os.Stdout.Fd()))