1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Add-on and cron logging

Discussion in 'XenForo Development Discussions' started by Sim, Mar 4, 2015.

  1. Sim

    Sim Well-Known Member

    How are people logging the activity of their add-ons - especially those with custom cron entries?

    There doesn't seem to be any reasonable generic log facility where these things should live.

    I'm not talking about just capturing server errors - which I expect would end up in the server error log, I'm also talking about informational updates (eg "X number of emails sent by this cron entry") and debugging - indeed something which can deal with all of the PSR-3 log levels (emergency, alert, critical, error, warning, notice, info, debug).

    Are you logging to a file? Custom DB table?

    As an aside - I think a generic activity log (with admin UI) which implements the PSR-3 logging interface would be very useful as part of the core.

    Add-ons can then log activity and errors there for the administrators to monitor.

    The UI would allow filtering log messages by date, PSR-3 log level and/or add-on id.

    We could also potentially extend the capabilities of this core logging facility to send log information to external application monitoring systems.

    I might add this as a suggestion.
  2. Sim

    Sim Well-Known Member

    Ahh - I just found the XenForo_Error::debug function, which is useful for development work.

    However, I would still like something which can optionally be used on a production server to log informational messages - particularly for checking the activity of cron entries.

    For now, I've implemented a very simple log file using Monolog. Might extend it to log to a custom database table in the future when I've got time.

Share This Page