Log Debug Info
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens
Writes a message to the Plant an App log files at Debug level. Use it to trace what an action list is doing, for example which branch ran or what value a token had, without showing anything to the user.
Debug messages are only written when the log level is set to Debug. By default it's Error, so the action does nothing visible until you change it. See Turning on debug logging.
This action is available in Listings and User Guides. In other modules, the same action is called Log Debug Message.
Typical Use Cases
- Check the value of a token at a certain point in an action list, for example
Order total: [Total] - Confirm which actions ran when a button behaves unexpectedly
- Leave tracing messages in place that only produce output when debugging is turned on
Don't use it to
- Record errors that need attention. Use Log Error, which is always written.
- Show a message to the user. Use Display Message.
- Keep an audit trail. Debug logging is usually off, so the messages won't be there. Save the data with Run SQL Query instead.
Related Actions
| Action Name | Description |
|---|---|
| Log Debug Message | The same action, under the name used in other modules. |
| Log Error | Writes a message at Error level, which is logged by default. |
| Log Event | Writes an entry to the event log. |
| Context to JSON Object | Collects tokens into one JSON value, which you can then log. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Message | The text to log, for example Loaded customer [CustomerId], status [Status]. | Yes | empty string | No |
Turning on debug logging
Plant an App writes its logs to daily files in Portals/_default/Logs/PlantAnApp/ on the server. The files are in compact JSON format.
The log level is set in DesktopModules/DnnSharp/Common/Config/appsettings.json, under Serilog > MinimumLevel. To see messages from this action, either lower the level for everything:
"MinimumLevel": {
"Default": "Debug"
}
or lower it only for this action, which keeps the log files small:
"MinimumLevel": {
"Default": "Error",
"Override": {
"DnnSharp.Common.Actions.Debug.LogDebug": "Debug"
}
}
The Debug Logging setting on the Tokens settings page only controls extra logging for tokens. It doesn't change the log level for this action.
Considerations
- Turn debug logging off again when you're done. At
Debuglevel, the whole platform logs a lot more, which fills the log files quickly. - Don't log secrets. Log files are plain text on the server. Avoid putting passwords, API keys or personal data in the message.
- The action never fails and doesn't change any tokens. The actions after it always run.
Examples
To understand how to use the below examples, please see Running Examples.
1. Trace a value before saving
This action logs the item being saved, so you can check the values in the log file when debug logging is on.
{
"Title": "Log Debug Info",
"ActionType": "LogDebug",
"Description": "Trace the order before it's saved",
"Parameters": {
"Message": "Saving order [OrderId] for customer [CustomerId], total [Total]"
}
}
Revised 09/26/2026