CI4 ,Change Log Message FileHandler |
hi,
how to change log message when page not found? into the log file , message "Class initialized using 'CodeIgniter\Session\Handlers\FileHandler' driver." i want to change the message include url.
If you want to know the 404 URI, I recommend you see Web server log files.
If you remove 404 from $ignoreCodes in Config/Exceptions.php, the 404 Exception will be logged. But if it is in production mode, the URI path is not included in the log. So useless. PHP Code: --- a/app/Config/Exceptions.php If v4.5.0 is released, the HTTP method and URI path will be logged: Quote:CRITICAL - 2023-11-12 10:05:01 --> Page Not Found (11-12-2023, 03:10 AM)kenjis Wrote: If you want to know the 404 URI, I recommend you see Web server log files. thanks kenjis ,but can i replace the default message before save into log file? not just for page not found, but all message log, (11-16-2023, 01:41 AM)kenjis Wrote: Extend Logger. thans kenjis , before i extend the logger, just a suggestion, maybe in the next feature, the uri can be included in every type message log that occurs.. so that we can quickly analyze which URLs are problematic, or which URLs have been attacked (11-16-2023, 02:09 AM)dhiya as Wrote:(11-16-2023, 01:41 AM)kenjis Wrote: Extend Logger. example i look into the log CRITICAL - 2023-11-16 07:45:02 --> The action you requested is not allowed. in SYSTEMPATH\Security\Security.php on line 300. 1 SYSTEMPATH\Security\Security.php(300): CodeIgniter\Security\Exceptions\SecurityException::forDisallowedAction() 2 SYSTEMPATH\Filters\CSRF.php(56): CodeIgniter\Security\Security->verify() 3 SYSTEMPATH\Filters\Filters.php(184): CodeIgniter\Filters\CSRF->before() 4 SYSTEMPATH\CodeIgniter.php(477): CodeIgniter\Filters\Filters->run() 5 SYSTEMPATH\CodeIgniter.php(361): CodeIgniter\CodeIgniter->handleRequest() 6 FCPATH\index.php(79): CodeIgniter\CodeIgniter->run() i dont know what the url access
@dhiya as
The feature has been implemented in 4.5 branch. https://github.com/codeigniter4/CodeIgniter4/pull/8108 (11-16-2023, 02:51 AM)kenjis Wrote: @dhiya as ok,,thank you kenjis.. |
Welcome Guest, Not a member yet? Register Sign In |