Skip to content
Output log messages while processing your Twig templates
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
services
twigextensions
README.md
SproutLogPlugin.php

README.md

Sprout Log

Output messages to a log file from your Twig templates

{% do log('This just happened.') %}

Your log file will appear in the logs folder:

craft/storage/runtime/logs/sproutlog.log

Notes

Sprout Log makes it possible to output messages to a log file in your Twig templates by using Twig's do tag to run the Sprout Log log() filter.

The log function is a wrapper for the plugin-specific Craft::log() method. The function called is SproutLogPlugin::log($message).

While it's unlikely this will be useful in many situations, when dealing with complex Twig processing order challenges, or writing articles on the processing order at Straight Up Craft, it's handy to be able to log points in time when Twig is processing to make sure you think you know what you think you know.

You can’t perform that action at this time.