Is there any way to create a custom log in Craft? I need to log some actions inside a controller/service in a custom plugin.
1 Answer
You can do this in your plugin:
ExamplePlugin::log('the is the log message');
the log method has the following signature:
log($msg, $level = LogLevel::Info, $force = false)
documentation is here
your log will appear in the app/storage/runtime/logs/pluginname.log
-
-
1if you have a custom plugin your will already have a main plugin class in the root of your plugin folder like ExamplePlugin.php this class will extend BasePlugin and thus get the static log function Commented Oct 3, 2014 at 12:07