Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (32 sloc) 1.21 KB

Logs messages to the database and adds log views to the admin.

Logging messages to the database

To persist a log message in the database, enable mod_logging in your Zotonic site. Then, in your code, send the #zlog{} notification:


some_function() ->
    %% do some things

            user_id = z_acl:user(Context),
                severity = ?LOG_ERROR,
                message_nr = MsgId,
                mailer_status = bounce,
                mailer_host = z_convert:ip_to_list(Peer),
                envelop_to = BounceEmail,
                envelop_from = "<>",
                to_id = z_acl:user(Context),
                props = []

E-mail log

The e-mail log is a separate view, which lists which email messages have been sent to which recipients. Any mail that gets sent gets logged here.

.. seealso::

    For regular application logging, use :ref:`Lager <dev-logging>` instead.

.. todo:: Add more documentation