Skip to main content
Version: 1.28 (Current)

Log Error

Audience: Low-code Engineers

Skill 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 Error list, 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​

Action NameDescription
Log EventAdds an entry of a type you choose to the Admin Logs.
Log Debug MessageWrites a message at Debug level.
Throw ExceptionStops the action list with an error.
Display Error MessageShows an error message to the user.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
MessageThe text to log. In an On Error list, include the error tokens, for example [ExceptionMessage].Yesempty stringNo

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 in Portals/_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