Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing logger to make subdirectories #520

Open
marabucz opened this issue Dec 16, 2021 · 0 comments
Open

Allowing logger to make subdirectories #520

marabucz opened this issue Dec 16, 2021 · 0 comments

Comments

@marabucz
Copy link

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.

@marabucz marabucz changed the title Allowing to make logger subdirectories Allowing logger to make subdirectories Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant