Managing Application Logs
Logging is one of the most important tools in a Developer's tool kit. Application logs allow Developers to debug applications in development and monitor them in production. The App Builder SDK and CLI provide significant capabilities to facilitate application logging from code, and viewing or forwarding them.
Logging with App Builder SDK
The App Builder SDK provides a core logging library that defines an API on top of the popular WinstonJS and Debug npm packages. The core logging library can be used in a Runtime action or in other libraries.
The App Builder core logging library can be also used with the App Builder core errors library. The core errors library streamlines error management across the AIO SDK and App Builder applications. When the core errors library is used in conjunction with the core logging library, error log messages output specific error codes, as defined by each App Builder SDK, that further aid debugging.
Both the core logging library and the core errors library can be used directly in an App Builder application, a Runtime action, and other libraries. For example, both libraries are used in:
- The App Builder SDK itself
- Higher-level SDK libraries such as the Real-time Customer Profile SDK library
- Shared Runtime actions such as the Token Vending Machine
data-slots=text
aio app init command, the generated boilerplate action code integrates with both the core and errors logging libraries by default.Accessing logs with App Builder CLI
App Builder CLI exposes application logs to Developers at different levels:
- At an App Builder application level, using the
aio appplugin - At a Runtime action level, using the
aio runtimeplugin
App Builder app plugin
The AIO CLI App plugin provides the aio app logs command, which fetches the logs for an App Builder application deployed to the App Builder Workspace configured in the current working folder. The command:
- Accepts an integer argument with the
--limitflag that allows fetching logs from the lastnRuntime activations - Accepts an action name with the
--actionflag that allows fetching logs from a particular action within the App Builder application - Allows a
--tailor--watchflag that continuously fetches logs as they appear
To see more command options, run aio app logs --help on your terminal.
The aio app logs command can be used by developers or by scripts running in a CI/CD pipeline. The command can also be used for App Builder Applications deployed on Runtime, or running locally through the aio app run --local command as discussed in the Deployment Guide.
Runtime plugin
The AIO CLI Runtime plugin operates at the level of a Runtime action. When a Runtime action is invoked, the corresponding activation's logs can be fetched using the aio runtime logs <activation_id> command.
This command also offers options to --watch or --tail the logs, and other options you can review by running aio runtime logs --help.
As with aio app logs, the aio runtime logs command can be used by Developers or by scripts running in a Deployment Guide. The command can also be used for App Builder applications deployed on Runtime or running locally through the aio app run --local command as discussed in the Deployment Guide.
Viewing logs in Adobe Developer Console
In addition to viewing logs via the CLI, you can view and search application logs directly in the Adobe Developer Console UI. This provides a convenient browser-based interface for debugging and monitoring your Runtime actions without needing to use command-line tools.
Accessing the Logs UI
To access your application logs in the Developer Console:
- Navigate to the Adobe Developer Console
- Select your organization and project
- Choose the workspace containing your deployed App Builder application
- Click on App Builder Logs in the left navigation menu
Features
The Logs UI displays logs from all your Runtime action activations, including both successful and failed invocations. Key features include:
-
View all activations: Unlike the default Runtime log storage (which only stores logs for failed or asynchronous activations), the Console UI shows logs from all action invocations
-
Search by action name: Use the search box to filter logs by action. You can enter:
- The full action path (e.g.,
mynamespace/mypackage/myaction) - A short action name (e.g.,
myaction)
- The full action path (e.g.,
-
Free-text search: Search within log messages for specific content such as error messages, log levels (
info,error,warn), or any text present in your logs
When to use the Console UI
The Developer Console Logs UI is ideal for:
- Quick debugging: Rapidly inspect recent action invocations without switching to a terminal
- Viewing successful activations: Access logs that wouldn't normally be stored in Runtime
- Ad-hoc searches: Find specific log entries across multiple activations
For more advanced log management needs such as long-term retention, complex queries, alerting, or correlation with other infrastructure logs, consider setting up log forwarding to a dedicated log management solution.
Tips for faster searches
To get the best performance from the Logs UI:
- Use the activation ID if you have it: Searching by a specific activation ID is the fastest way to find logs for a particular invocation
- Start with a narrow time range: Begin with a short time window and only widen it if you don't find what you're looking for
- Avoid broad keyword searches over long time windows: Combining generic search terms with extended time ranges can slow down results
Forwarding Application logs
In addition to viewing application logs using the AIO CLI, Developers can configure App Builder applications to forward all application logs to a customer-owned log management solution. Forwarding logs has several benefits over retrieving them through the AIO CLI, especially for applications deployed in Production or Staging environments.
Supported log management solutions include:
- Adobe I/O Runtime (default)
- Splunk Cloud
- Splunk Enterprise
- Azure Log Analytics
- New Relic
Follow these links to see how to set up log forwarding using each solution.
When to use log forwarding
This table compares storing application logs in Adobe I/O Runtime and forwarding them to a log management solution:
Stage and Production workspaces.x-ow-extra-logging header directs Adobe I/O Runtime to store all application logs. But it's meant to be used only in local development, and overuse is throttled at high log volumes.x-ow-extra-logging is unnecessary: logs are forwarded by design.Log forwarding commands
Setting log forwarding
This command allows you to configure log forwarding for your workspace or reset it to store logs in Adobe I/O Runtime:
aio app config set log-forwarding
Once a log forwarding configuration is set, it is stored in the .aio and .env files. Any changes made to the configuration in the .aio or .env file will be deployed when you run aio app deploy.
Running aio app deploy --no-actions or aio app deploy --no-log-forwarding-update skips deployment of these changes.
Please visit the Guide for your log management solution of interest to see how to set up log forwarding.
Viewing the current log forwarding configuration
This command displays the current log forwarding configuration for your workspace and compares it to the locally set log forwarding configuration:
aio app config get log-forwarding
If log forwarding is not configured for your workspace, Adobe I/O Runtime will be returned by default. Note that for security reasons, Adobe never returns configured secrets from our servers.
Debugging log forwarding
This command outputs any errors that occurred when application logs were being forwarded to your configured log management solution:
aio app config get log-forwarding errors
It returns the most recent 10 log forwarding errors for the current log forwarding configuration, to a maximum of 30 days.
Next steps
Return to Guides Index.
Return to App Builder Overview.