We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to use OTel logger with simple stdout and the Body is just not outputted
package main import ( "context" "fmt" "time" "go.opentelemetry.io/otel/exporters/stdout/stdoutlog" log2 "go.opentelemetry.io/otel/log" "go.opentelemetry.io/otel/sdk/log" ) func main() { processor, err := stdoutlog.New() if err != nil { fmt.Println(err.Error()) return } p := log.NewLoggerProvider(log.WithProcessor(log.NewBatchProcessor(processor))) l := p.Logger("test-stdout") r := log2.Record{} r.SetBody(log2.StringValue("This body will not show")) r.SetSeverityText("FATAL") r.SetSeverity(log2.SeverityFatal) l.Emit(context.Background(), r) time.Sleep(5 * time.Second) }
Mod:
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 go.opentelemetry.io/otel v1.26.0 go.opentelemetry.io/otel/metric v1.26.0 go.opentelemetry.io/otel/trace v1.26.0 go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240506090312-e0ed6a3028be // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.2.0-alpha // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.26.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.26.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.26.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.26.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutlog v0.2.0-alpha // indirect go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.26.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.26.0 // indirect go.opentelemetry.io/otel/log v0.2.0-alpha // indirect go.opentelemetry.io/otel/sdk v1.26.0 // indirect go.opentelemetry.io/otel/sdk/log v0.2.0-alpha // indirect go.opentelemetry.io/otel/sdk/metric v1.26.0 // indirect go.opentelemetry.io/proto/otlp v1.2.0 // indirect
Output:
{"Timestamp":"0001-01-01T00:00:00Z","ObservedTimestamp":"2024-05-07T18:32:51.099086+03:00","Severity":21,"SeverityText":"FATAL", "Body":{},"Attributes":[],"TraceID":"00000000000000000000000000000000","SpanID":"0000000000000000","TraceFlags":"00","Resource":[{"Key":"service.name", "Value":{"Type":"STRING","Value":"unknown_service:___go_build_playground_git_otel"}},{"Key":"telemetry.sdk.language","Value":{"Type":"STRING","Value":"go"}}, {"Key":"telemetry.sdk.name","Value":{"Type":"STRING","Value":"opentelemetry"}}, {"Key":"telemetry.sdk.version","Value":{"Type":"STRING","Value":"1.26.0"}}],"Scope":{"Name":"test-stdout","Version":"","SchemaURL":""},"AttributeValueLengthLimit":0,"AttributeCountLimit":0}
"Body":{} should be: "Body":{"This body will not show"}
"Body":{}
"Body":{"This body will not show"}
The text was updated successfully, but these errors were encountered:
cc @XSAM
Sorry, something went wrong.
XSAM
Successfully merging a pull request may close this issue.
Description
I am trying to use OTel logger with simple stdout and the Body is just not outputted
Environment
Steps To Reproduce
Mod:
Output:
Expected behavior
"Body":{}
should be:
"Body":{"This body will not show"}
The text was updated successfully, but these errors were encountered: