Log Error
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Writes an error message to the logs. The message goes to the Plant an App log files and to the site's Admin Logs, where administrators can see it under Logs > Event in the Plant an App configuration. Nothing is shown to the user, and the actions after it keep running.
Typical Use Cases
- Record the details of a failure in an
On Errorlist, for example after Run SQL Query or Server Request, before showing the user a friendly message - Record a situation that shouldn't happen, such as a missing setting, without stopping the process
Don't use it to
- Stop the process. Use Throw Exception, which fails the action list with an error.
- Log tracing information. Use Log Debug Message, which is only written when debugging is turned on.
- Log an event of a specific type, such as an admin alert. Use Log Event.
- Show an error to the user. Use Display Error Message.
Related Actions
| Action Name | Description |
|---|---|
| Log Event | Adds an entry of a type you choose to the Admin Logs. |
| Log Debug Message | Writes a message at Debug level. |
| Throw Exception | Stops the action list with an error. |
| Display Error Message | Shows an error message to the user. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Message | The text to log. In an On Error list, include the error tokens, for example [ExceptionMessage]. | Yes | empty string | No |
Considerations
- Error messages are always logged. The default log level is
Error, so you don't need to turn anything on. The log files are inPortals/_default/Logs/PlantAnApp/on the server. - Don't log secrets. Avoid putting passwords, API keys or personal data in the message. Administrators can read the Admin Logs, and the log files are plain text on the server.
- The action never fails and doesn't change any tokens.
Examples
tip
To understand how to use the below examples, please see Running Examples.
1. Log a failed SQL query
Add this action to the On Error list of a Run SQL Query action. It records the error and who ran the query. Follow it with a message for the user.
{
"Title": "Log Error",
"ActionType": "LogError",
"Description": "Log the SQL error",
"Parameters": {
"Message": "SQL error for [User:Username] (ID [User:UserID]): [ExceptionType] - [ExceptionMessage]"
}
}
Revised 09/27/2026