Add-on and cron logging


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.


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.


Well-known member
Bumping this.. did you end up using Monolog or did you implement something else? I've got a cronjob that calls an external API that I need to log the response for troubleshooting. I will likely go the custom table route I guess..