mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #153] Why can't this logger log objects? Why only arrays? #51
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#51
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 @jeffreytgilbert on GitHub (Jan 29, 2013).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/153
FirePHP supports objects. ChromePHP supports objects. In fact, some objects even have toString methods just for this very purpose. So, why can't we send objects to the logs or can we and I'm missing something. It better not be for some silly reason like "saving file space in text logs" or something. I may have to fork this project to integrate that change if there isn't a way to do it natively that I'm missing.
@jeffreytgilbert commented on GitHub (Jan 29, 2013):
Seems like from another message that you can but you have to stuff that object or array into an array... what? Crazy town. I think I'm going to end up having to change this in my adoption, and I find myself not wanting to. 🎱
@jeffreytgilbert commented on GitHub (Jan 29, 2013):
Looks like it is able to process objects, and after a workaround, I was able to make the interface super nice for the framework.
NON ISSUE.
@Seldaek commented on GitHub (Jan 29, 2013):
Not sure what happened here, but yes you can give an object in the context array, as long as it's wrapped in an array. It's probably best anyway to have array('user' => $user) than just an object without contextual information as to what it is meant to be. Especially if you log multiple things.