logline
Function: Write to application log
This function allows you to record important messages and events directly into your application's log files. This is useful for tracking the flow of your application, debugging issues, or monitoring specific actions performed by users or the system.
Input
- Text (Required): A piece of text. This is the main message you want to write to your application logs.
- Logline placeholders: A list of key/value pairs combined in an object. If your "Text" contains special placeholders like
\{\{PLACEHOLDER_NAME\}\}
, you can provide values here to automatically replace them. For example, if your text is "User {{USERNAME}} logged in", you would provide a placeholder namedUSERNAME
with the actual user's name. - Level: A selection from a dropdown. This determines the severity or importance of the log entry.
- Error: For critical issues that prevent the application from functioning correctly.
- Debug: For detailed information useful during development or troubleshooting.
- Warn: For potential issues that don't stop the application but might need attention.
- Info (Default): For general information about the application's progress.
- Trace: For very fine-grained information, typically used for deep debugging.
Output
This function does not produce a direct output that can be used in subsequent steps of your workflow. Its primary purpose is to record information in your application's internal logs.
Execution Flow
Real-Life Examples
-
Logging a successful user action:
- Inputs:
- Text: "User {{USERNAME}} successfully updated their profile."
- Logline placeholders:
USERNAME
: "Alice" - Level: Info
- Result: A message "User Alice successfully updated their profile." is recorded in the application logs at the Info level, providing a clear audit trail of user activity.
- Inputs:
-
Recording a system error:
- Inputs:
- Text: "Failed to connect to external payment gateway. Error code: {{ERROR_CODE}}"
- Logline placeholders:
ERROR_CODE
: "503" - Level: Error
- Result: A critical message "Failed to connect to external payment gateway. Error code: 503" is logged at the Error level, immediately alerting administrators to a problem that needs attention.
- Inputs:
-
Debugging a specific process step:
- Inputs:
- Text: "Processing item {{ITEM_ID}}. Current status: {{STATUS}}"
- Logline placeholders:
ITEM_ID
: "ABC-123",STATUS
: "Validation Started" - Level: Debug
- Result: A detailed message "Processing item ABC-123. Current status: Validation Started" is added to the application logs at the Debug level. This helps developers or support staff trace the exact steps of a complex process during troubleshooting.
- Inputs: