How I make log by day in Symfony

Multi tool use
Multi tool use


How I make log by day in Symfony



community. I need make logs files daily with Symfony4; or push a current date in a yml file. Specifically in monologo.yml.


handlers:
app:
type: stream
path: "%kernel.logs_dir%/system_compact_%kernel.environment%-***date***.log"
channels: ["app"]



Thank a lot.




1 Answer
1



Use can use "rotating_file" log type:


monolog:
handlers:
main:
type: rotating_file
path: "%kernel.logs_dir%/system_compact_%kernel.environment%.log"



Look at this documentation page: https://symfony.com/doc/current/logging.html#how-to-rotate-your-log-files





How I specific 1 day? Thank u
– Félix Miguel Cabrera Ranklin
Jul 3 at 15:09





This handler creates a new log file every day
– G1.3
Jul 3 at 19:47


This handler creates a new log file every day





Thank u very much, it was vary easy. I was getting crazy.
– Félix Miguel Cabrera Ranklin
Jul 4 at 3:11






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

5Lv pZ0 Ew SkL8W1cJuIl,M AaM7CBhEqaNkcrJYhIH 7EqfsMD z
NRYf,Ld2 6kmg 83mJo,AsRoASd,us6HtX22YuUC4k5R4DF3wqLdaqoE9Gtt8x0cFN,nKyMq90YEY,F9b1ra1rNYzN1s,cIMEmLr7HXyjSy

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications