You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having some clients with attitude of "prove me this is NOT your problem" or "prove me this WAS really done" I'm really happy for logger, however... some projects grew nastily, and having to log basically anything important just to be sure I won't be burnt and blamed for everything I started having an urge to split logs. The first logical idea was Debugger::log('mail sent', 'mails-'. date('Y-m'))
That's cool, because now you have all your mails together - mails-2012-09, mails-2012-10 etc., but it would be probably better to have them in directories. Like 2021-12/mails, 2021-12/orders, 2021-12/smartemailing etc. The good thing is logger allows that, as https://github.com/nette/tracy/blob/master/src/Tracy/Logger/Logger.php#L63 works even with directories. The bad part is... you need to create directories first. It would be really awesome to have something like if(!is_dir($dir = dirname($file))) { @mkdir($dir); }
on the line 64... I mean I know I can make my own logger and thus solve this (and basically add that date('Y-m') right into constructor, so I don't have to thing about dividing my logs into directories and in that case even my errors etc. would be splitted, but it would be still a nice feature into standard one.
The text was updated successfully, but these errors were encountered:
marabucz
changed the title
Allowing to make logger subdirectories
Allowing logger to make subdirectories
Dec 16, 2021
Having some clients with attitude of "prove me this is NOT your problem" or "prove me this WAS really done" I'm really happy for logger, however... some projects grew nastily, and having to log basically anything important just to be sure I won't be burnt and blamed for everything I started having an urge to split logs. The first logical idea was
Debugger::log('mail sent', 'mails-'. date('Y-m'))
That's cool, because now you have all your mails together - mails-2012-09, mails-2012-10 etc., but it would be probably better to have them in directories. Like
2021-12/mails
,2021-12/orders
,2021-12/smartemailing
etc. The good thing is logger allows that, as https://github.com/nette/tracy/blob/master/src/Tracy/Logger/Logger.php#L63 works even with directories. The bad part is... you need to create directories first. It would be really awesome to have something likeif(!is_dir($dir = dirname($file))) { @mkdir($dir); }
on the line 64... I mean I know I can make my own logger and thus solve this (and basically add that date('Y-m') right into constructor, so I don't have to thing about dividing my logs into directories and in that case even my errors etc. would be splitted, but it would be still a nice feature into standard one.
The text was updated successfully, but these errors were encountered: