View logs

Akka provides logs that you can view in the Console or access with the CLI. For each service instance we aggregate a maximum of 1MB of log data. You can capture all log output by attaching a logging provider, such as Google Cloud’s operations suite (formerly Stackdriver), as described here.

Aggregated logs

To view aggregated logs:

Browser
  1. From the project Dashboard, select a deployed service.

  2. From the service Overview page, select Logs from the top tab or from the left navigation menu. The Logs table displays logging output, which you can filter with the control on top.

CLI

With a command window set to your project, use the akka logs command to view the logs for a running service:

akka logs <<service-name>>

To stream new log lines as they arrive, add --follow. Use --tail to set how many existing lines the command fetches first:

akka logs <<service-name>> --follow --tail 50

Exporting logs

Logs can be exported for searching, reporting, alerting and long term storage by configuring the Akka observability configuration for your project. See here for detailed documentation.

Correlating logs with traces

When tracing is enabled, JSON log messages written while Akka handles a traced request or message include these fields:

  • trace_id: the ID of the trace, 32 hexadecimal characters.

  • span_id: the ID of the current span, 16 hexadecimal characters.

  • trace_flags: the W3C trace flags, for example 01 for a sampled trace.

Use the trace ID to find the trace of a log message in your tracing backend. For more information on tracing, see Traces.

Akka adds the fields to logs written from:

  • command handlers of entities, workflows, timed actions and agents

  • consumers and view updaters. A view updater has the span of the event, which is the span that wrote the event.

  • workflow steps and agent function tools

  • HTTP and gRPC endpoint methods, and MCP endpoint tools, prompts and resources

If you start a span with tracing().startSpan(…​) and make it current, logs written in that scope carry the ID of your span.

Akka sets the trace context on the thread that calls your code. Logs written later on another thread, for example in a callback on a returned CompletionStage, do not include the fields.

Akka does not set the trace context around every method it calls. Logs written from these do not include the fields:

  • the map and onFailure functions of an agent effect

  • guardrails and evaluators

  • the other methods of an autonomous agent