Console Logger icon

Console Logger

Log workflow data and custom messages to n8n console for debugging

Console Logger

AI-generated

Overview

This node logs workflow data and custom messages to the n8n console for debugging purposes. It is useful for monitoring workflow execution, troubleshooting issues, and auditing data processing by logging messages at different levels (debug, info, warn, error, log). For example, it can log a custom message about user processing status, full JSON data of items, specific fields from the data, or a combination of message and data.

Use Case Examples

  1. Logging a custom message with user status during workflow execution.
  2. Logging the full JSON data of each item processed for detailed inspection.
  3. Logging specific fields like username and email to focus on relevant data.
  4. Logging both a custom message and full data for comprehensive logging.

Properties

Name Meaning
Log Level Specifies the severity level of the log message (debug, info, warn, error, log).
What to Log Determines what content to log: a custom message, full item data, specific fields, or both message and data.
Message Custom message to log, supporting n8n expressions. Used when logging a message or both message and data.
Fields to Log Comma-separated list of specific field names to log from the item data. Used when logging specific fields.
Options Additional logging options including prefix for messages, pretty print JSON formatting, inclusion of timestamp, and inclusion of item index when processing multiple items.

Output

JSON

  • json
    • _consoleLog
      * message - The final log message string that was output to the console.
      * level - The log level used for the message.
      * timestamp - Timestamp when the log message was created.
  • pairedItem
    • item - Index of the item in the input array to which this log corresponds.

Troubleshooting

  • Ensure that the expressions used in custom messages are valid to avoid runtime errors.
  • If logging specific fields, verify that the field names are correctly spelled and exist in the item data to avoid empty logs.
  • When processing multiple items, enabling the item index option helps distinguish logs; disabling it may cause confusion.
  • If no output appears in the console, check the log level setting to ensure it matches the desired verbosity.

Discussion