Issue
How can i add the log in file with prestashop 1.7?
Solution
$logger = new FileLogger(0); //0 == debug level, logDebug() won’t work without this.
$logger->setFilename(_PS_ROOT_DIR_."/log/debug.log");
$logger->logDebug("message 1");
$logger->logDebug("message 2");
Debug messages will look like this (inside "/log/debug.log" at root dir in Prestashop):
DEBUG 2018/08/13 – 14:31:48: Hello world
I hope this helps somebody :-). Cheers.
Answered By - Kamlesh Gupta Answer Checked By - David Marino (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.