HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Several questions about how to print logs in both application and plugin.
edited January 2021 in Community Addons & Development
I found myself struggling at printing log while developing the code.
I have set below to true
$Configuration['Garden']['Errors']['LogEnabled'] = TRUE; $Configuration['Garden']['Errors']['LogFile'] = 'log/error_log';
However, I examine both the vanilla and vanilla-docker folders and can't find the log file. Anyone know where does the error_log file locate? Or maybe I did something wrong?
AFAIK, Logger::debug() can not be used in plugin. May I know what is the recommended way to print log in the plugin?
Appreciate any information. Thanks.
i put this and log file is in the vanilla root folder
Thanks, @pioc34 ! As you pointed out, I can see the log printed in the vanilla.log file. I appreciate it very much!!
With regards to the Plugins, do you have any idea of how to print logs or show debug message in Plugin while the application is running? I tried to utilise "errorLog()", which is working in the application, but not working in Plugin. I can't see any log printing out.
Any direction or hint would be really appreciated. Thanks!
Welcome new Vanilla-developer! 😃
Not sure about the problems with the Logger class, but I would use the helper function logMessage as it is described here: https://open.vanillaforums.com/discussion/26786/tutorial-how-to-enable-a-debug-log-and-collect-debugging-information
logMessage(__FILE__, __LINE__, get_class($this), __METHOD__, 'YEAH', 'Whatever');
This is the docblock describing the parameters: