mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #581] create logdir if not exists #203
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#203
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dominikzogg on GitHub (Jun 18, 2015).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/581
Hello @Seldaek
Would be cool if the StreamHandler or another handler would be able to create the log directory (if its a path, not a stream), if it not exists.
see: https://github.com/silexphp/Silex/pull/1183
If you like the idea i would prepare a pullrequest.
Regards @dominikzogg
@Seldaek commented on GitHub (Jun 18, 2015):
See #555 - but if you can provide a safe implementation I am not really against it..
@dominikzogg commented on GitHub (Jun 19, 2015):
@Seldaek well a resource definition is a string, which has :// within, or a resource itself, isn't it?
@Seldaek commented on GitHub (Jun 19, 2015):
'foo.log' is valid, 'file://foo.log' is valid but has ://, ftp://foo.log is valid but should perhaps not get mkdir called on it (well I guess with ftp it works but not necessarily with other streams). I think doing a is_dir+mkdir check for file:// or no-protocol paths is probably safe.
@dominikzogg commented on GitHub (Jun 20, 2015):
@Seldaek You mean only paths with file:// should get considered? Would be a compromise i could live with, should be in documentation as well. Should i prepare a pull request which works like this?
@Seldaek commented on GitHub (Jun 20, 2015):
No I mean paths with file:// and those that don't have a protocol defined, like "foo.log" has no
XXX://and as such you know php defaults to the file:// stream. And yes if you like to send a PR please go ahead :)