PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, October 27, 2022

[FIXED] How to add the custom file log in prestashop?

 October 27, 2022     prestashop, prestashop-1.7     No comments   

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)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing