{debuglog:text}

Description

Writes a message to the AA system log and returns an empty string. The text you pass is stored as a log entry of type DEBUG, together with the current user, module, IP address and request URI, so you can trace when and where a template was rendered. It produces no visible output - it is a diagnostic side effect, the template counterpart of writing to a server log. Use it to record that a branch was reached, dump a value into the log, or mark a render in the admin log viewer (aa_log.php). Because logging happens every time the template is expanded, it is never cached. View the entries under Logs in the admin interface, filtered by event type DEBUG.

Parameters

text optional default (empty string)

The message to write to the AA log. Any string - a literal note, or template output expanded first (for example a field value or a counter). Stored verbatim as the log entry. If empty, an empty DEBUG entry is still written.

Examples

testbefore{debuglog:reached step 2}after
Expectedbeforeafter
Actualbeforeafter
Placed inline, the call leaves no gap and no marker - before and after sit next to each other. Use it to record that a branch of a template was reached without disturbing the output.
test[{debuglog:user count is {count:1-2-3}}]
Expected[]
Actual[]
The text is expanded first, so the inner count is evaluated and the string user count is 3 is what gets logged. The inline output is still empty - logging never changes what the visitor sees.
test[{debuglog}]
Expected[]
Actual[]
The text parameter is optional and defaults to an empty string. With no argument an empty DEBUG entry is still written and the inline result is empty. Pass a meaningful message so the log row is useful.
test[{debuglog:item import finished}]
Expected[]
Actual[]
The command returns an empty string, so nothing appears on the page - the message goes only to the AA log. The brackets show the empty inline result. Behind the scenes a DEBUG log entry holding item import finished is written, viewable under Logs in the admin.