Skip to content

[Monolog] Update monolog_email.rst #14439

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

Open
wants to merge 1 commit into
base: 4.4
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions logging/monolog_email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ actually deals with emailing you the error. The settings for this are
straightforward, the to and from addresses, the formatter, the content type
and the subject.

.. tip::

If you use messenger, make sure that your message class implements ``\JsonSerializable`` in order to get the message content in your logs, because messenger uses his monolog directly and his context serializer wish use ``json_encode`` for seriliazation. That's why we need to customize JSON representation when encoded is done with ``json_encode``.
Copy link

@Matts Matts Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ahmed-bhs!

Can you explain what you are trying to say here:
"because messenger uses his monolog directly and his context serializer wish use json_encode for sterilization."

maybe I can give some suggestions to make it more clear :)


You can combine these handlers with other handlers so that the errors still
get logged on the server as well as the emails being sent:

Expand Down