diff --git a/content/en/docs/languages/go/exporters.md b/content/en/docs/languages/go/exporters.md index 8fdf2bb451e5..499181f80a71 100644 --- a/content/en/docs/languages/go/exporters.md +++ b/content/en/docs/languages/go/exporters.md @@ -3,7 +3,7 @@ title: Exporters aliases: [exporting_data] weight: 50 # prettier-ignore -cSpell:ignore: otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdouttrace +cSpell:ignore: otlpmetric otlpmetricgrpc otlpmetrichttp otlptrace otlptracegrpc otlptracehttp promhttp stdoutlog stdouttrace --- {{% docs/languages/exporters/intro go %}} @@ -49,6 +49,25 @@ func newExporter() (metric.Exporter, error) { } ``` +### Console logs (Experimental) {#console-logs} + +The +[`go.opentelemetry.io/otel/exporters/stdout/stdoutlog`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog) +package contains an implementation of the console log exporter. + +Here's how you can create an exporter with default configuration: + +```go +import ( + "go.opentelemetry.io/otel/exporters/stdout/stdoutlog" + "go.opentelemetry.io/otel/sdk/log" +) + +func newExporter() (log.Exporter, error) { + return stdoutlog.New() +} +``` + ## OTLP To send trace data to an OTLP endpoint (like the [collector](/docs/collector) or diff --git a/static/refcache.json b/static/refcache.json index 5ce0ab8939a6..64c8d0830186 100644 --- a/static/refcache.json +++ b/static/refcache.json @@ -6875,6 +6875,10 @@ "StatusCode": 200, "LastSeen": "2024-01-18T19:07:44.890589-05:00" }, + "https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutlog": { + "StatusCode": 200, + "LastSeen": "2024-04-24T13:46:14.851022-07:00" + }, "https://pkg.go.dev/go.opentelemetry.io/otel/exporters/stdout/stdoutmetric": { "StatusCode": 200, "LastSeen": "2024-01-30T15:25:21.196671-05:00"