The $dotlogger viewtool enables you to write messages to the dotCMS log files from your Velocity code.
Method | parameter | Description |
---|---|---|
debug | String | Logs a message at the DEBUG logging level. |
error | String | Logs a message at the ERROR logging level. |
info | String | Logs a message at the INFO logging level. |
warn | String | Logs a message at the WARN logging level. |
printTemplateStack | none | Logs a stack trace of the Velocity templates at INFO logging level. |
Messages will written to the dotCMS log files based on the Logging Configuration.
The following example shows how the logger tool is mapped in the toolbox.xml file:
<tool>
<key>dotlogger</key>
<scope>request</scope>
<class>com.dotcms.rendering.velocity.viewtools.DotLoggerTool</class>
</tool>