Actions88
- Container Actions
- Container List
- Container Create
- Container Inspect
- Container Top
- Container Logs
- Container Changes
- Container Export
- Container Stats
- Container Resize
- Container Start
- Container Stop
- Container Restart
- Container Kill
- Container Update
- Container Rename
- Container Pause
- Container Unpause
- Container Attach
- Container Attach Websocket
- Container Wait
- Container Delete
- Container Archive Info
- Container Archive
- Put Container Archive
- Container Prune
- Image Actions
- Network Actions
- Volume Actions
- Swarm Actions
- Node Actions
- Secret Actions
- System Actions
- Exec Actions
- Service Actions
- Task Actions
Overview
This node allows users to retrieve logs from Docker containers managed via the Portainer API. It is useful for monitoring container output, debugging issues, or auditing container activity by fetching standard output and error logs. Typical use cases include:
- Viewing real-time logs of a running container.
- Fetching historical logs within a specific time range.
- Filtering logs to only show stdout or stderr.
- Tailoring log output size to recent lines or full logs.
For example, a DevOps engineer might use this node to automatically collect logs from a container after deployment to verify successful startup or diagnose errors.
Properties
| Name | Meaning |
|---|---|
| EndpointID Name or ID | The Portainer endpoint identifier used to access the Docker environment. Can be selected from a list or specified via an expression. |
| Id | The ID or name of the Docker container whose logs are to be retrieved. |
| Additional Fields | Optional parameters to customize the logs retrieval: |
| - Follow | Boolean flag to keep the connection open and stream logs continuously after initial retrieval. |
| - Stdout | Boolean flag to include logs from the container's standard output stream. |
| - Stderr | Boolean flag to include logs from the container's standard error stream. |
| - Since | UNIX timestamp to return logs only since this time (filters out older logs). |
| - Until | UNIX timestamp to return logs only before this time (filters out newer logs). |
| - Timestamps | Boolean flag to prepend timestamps to each log line. |
| - Tail | Number of log lines to return from the end of the logs, or "all" to return all available lines. |
Output
The node outputs JSON data containing the logs retrieved from the specified container. The exact structure depends on the Portainer API response but typically includes the raw log text lines. If streaming (Follow) is enabled, the node may output logs incrementally as they arrive.
No binary data output is indicated.
Dependencies
- Requires a Portainer API endpoint with Docker access.
- Needs an API key credential configured in n8n to authenticate requests to the Portainer API.
- The node uses the Portainer API base URL and endpoint ID to construct requests.
Troubleshooting
- Invalid Endpoint or Container ID: Ensure the endpoint ID and container ID/name are correct and accessible via the Portainer API.
- Authentication Errors: Verify that the API key credential is valid and has sufficient permissions.
- Empty Logs: Check if the container is running and producing logs; also verify the
sinceanduntiltimestamps do not exclude all logs. - Connection Timeout with Follow Enabled: Streaming logs requires a persistent connection; network issues or API limits may cause disconnections.
- Incorrect Property Types: For example,
tailshould be an integer or "all"; invalid values may cause errors.