[issue18345] logging: file creation options with FileHandler and friends

2013-11-05 Thread Vinay Sajip
Vinay Sajip added the comment: When the online docs update, the cookbook entry should appear at http://docs.python.org/dev/howto/logging-cookbook.html#customising-handlers-with-dictconfig -- ___ Python tracker ___

[issue18345] logging: file creation options with FileHandler and friends

2013-11-05 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5636366db039 by Vinay Sajip in branch '3.3': Issue #18345: Added cookbook example illustrating handler customisation. http://hg.python.org/cpython/rev/5636366db039 New changeset 388cc713ad33 by Vinay Sajip in branch 'default': Closes #18345: Merged

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip
Vinay Sajip added the comment: > But can I pass the file owner in the config dict? You should be able to; I'll address that in the example. -- ___ Python tracker ___ ___

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > If you are using dictConfig(), you don't need to specify a class for > your handler: you can specify a callable which configures and returns > a handler, and the callable could be a function which created a file > with appropriate ownership and then returned a

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip
Vinay Sajip added the comment: If you are using dictConfig(), you don't need to specify a class for your handler: you can specify a callable which configures and returns a handler, and the callable could be a function which created a file with appropriate ownership and then returned a FileHand

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Instead, a mixin which redefined _open would seem to fulfil the > requirements, and the same strategy could be used to cater for other > requirements without any stdlib changes. One desireable aspect is to still be able to configure logging using dictConfig(

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Claudiu.Popa
Claudiu.Popa added the comment: Sure, thanks for the review, it's really insightful regarding API design. I will try to contribute an example for the cookbook later this day. -- ___ Python tracker

[issue18345] logging: file creation options with FileHandler and friends

2013-11-04 Thread Vinay Sajip
Vinay Sajip added the comment: This issue had dropped off my radar, thanks for bringing it back into view. I see that the patch follows Antoine's suggestion of a "chown" parameter, but I'm not sure that's the best way to provide this functionality. What concerns me about a "chown" parameter:

[issue18345] logging: file creation options with FileHandler and friends

2013-11-03 Thread Claudiu.Popa
Changes by Claudiu.Popa : Added file: http://bugs.python.org/file32475/logging.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue18345] logging: file creation options with FileHandler and friends

2013-11-03 Thread Claudiu.Popa
Claudiu.Popa added the comment: Added documentation and the chown parameter for the friends of FileHandler. Should tests be added for those classes as well or is it enough to test FileHandler? -- Added file: http://bugs.python.org/file32474/logging.patch __

[issue18345] logging: file creation options with FileHandler and friends

2013-11-03 Thread Claudiu.Popa
Claudiu.Popa added the comment: Hello. Patch attached. -- keywords: +patch nosy: +Claudiu.Popa Added file: http://bugs.python.org/file32473/logging.patch ___ Python tracker ___ _

[issue18345] logging: file creation options with FileHandler and friends

2013-07-02 Thread Antoine Pitrou
New submission from Antoine Pitrou: When starting a service as root, you may want your log files to be created as another user (the service may drop privileges later). It would be nice to have a "chown" option to FileHander. For example it could take either a "username" string, or a ("username