-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Need extended information on Logging #434
Comments
What do you think about this? If it's suitable we'll turn it into a How Do I topic. |
@xcomSteveJohnson Yup, that's a good template to use for a dev docs argument, and the sort of thing I was thinking about. |
Thank you. Created internal issue MAGETWO-47820 to track |
@astorm Let us know what you think: http://bit.ly/29xO5Hd |
A good first draft, but it doesn't go far enough. You mention
However, I don't see any concrete example of how this works. i.e. you say you can log to files, but the three articles don't show which files get logged to. Some like like
It's also not clear from the above if Magento has stock loggers for logging to email, Chrome, etc, or if you're just pointing out one could implement something like this themselves. |
Agreed. It is a nice first draft, but does lack a lot of details for understanding how to utilize a logger affectively. There are two handlers currently defined in the Magento di.xml that will write to the
The way Monolog works is that it has the capability to "bubble" a message from one handler on to the next one in the list if the handler allows the record to be bubbled. When the System handler's constructor is called when instantiated it will build a handler that So in instances of using If you are going to make a few examples, I'd suggest doing some As far as extending the capabilities of Monolog for the other ways you can use logging, like you hint at in logging to a database, you may find that providing an example of that is a bit more difficult because that kind of capability would be provided by additional handlers. There are some fundamental issues with adding any additional handlers to the I implemented a separate Monolog file handler and database handler, but wasn't able to find a way to utilize the Magento Logger, so I ended up writing my own Logger and injecting it instead of the |
@mttjohnson Thanks for your input. We'll keep you posted. |
Fixed FTF guide name (ds_ftf-guide-rename)
Any update on is, or is this not going to happen? |
I'm waiting on input from engineering. I don't have an ETA for that. |
Thanks for the update @xcomSteveJohnson -- we live in hope :) |
Help us improve the Custom logging topic by adding more details and examples. Refer to our Contribution guidelines for more information. Acceptance criteria:
|
Hi @RakeshJesadiya - Do you want to pick up work on this? We feel like you may have the answers we need! |
Generally i use this old Magento 1 technique to print all logs in our custom modules, by adding this much code in helper. |
Hello |
Hello guys. I think I can describe it. Could you please assign this issue to me? |
Already described in https://devdocs.magento.com/guides/v2.2/config-guide/log/custom-logger-handler.html @astorm, could you please let us know if the mentioned topic answers on your questions? Many thanks and Merry Christmas! |
Uh oh!
There was an error while loading. Please reload this page.
Original Ticket Suggestion
Suggestion for http://devdocs.magento.com/guides/v2.0/howdoi/bk-how-do-i.html
How do module developers log a message to
system.log
when creating their own modules?How do module developers log a message to a custom log file?
Existing content in DevDocs
https://devdocs.magento.com/guides/v2.2/config-guide/log/log-intro.html
https://devdocs.magento.com/guides/v2.2/config-guide/log/log-magento.html
https://devdocs.magento.com/guides/v2.2/config-guide/log/log-db.html
Need more information!
Read through the comments for ideas and deeper technical information we could use in these topics!
The text was updated successfully, but these errors were encountered: