CI4 Customizing Logger filename |
Hi,
I am a real fan of CI3 for years ... and recently decided to create a new project using CI4 . Couldn't find a way to have multiple log files.... I usually create my own log helper , and have tricks that I like to customize on the logging. One of the important one , is having the ability to give the logger a different log file name . So instead of having one log : log-YYY-MM-DD.log , I'd like to have : log-billing-YYY-MM-DD.log log-accounts-YYY-MM-DD.log log-orders-YYY-MM-DD.log log-products-YYY-MM-DD.log etc .... Can't find a way to do it. I saw this post , https://forum.codeigniter.com/thread-78665.html AngelRodriguez is showing how to modify the log path For instance : PHP Code: use Config\Logger as LoggerConfig;
Create your own FileHandler based on (extends) system/Log/Handlers/FileHandler.php,
and configure to use it in app/Config/Logger.php. |
Welcome Guest, Not a member yet? Register Sign In |