I have seen (and have been instructed to use) the moodle log as a place for logging the following:
General information for debugging REST API calls (info level)
External REST API call failures (warning / error level)
Configuration errors during schedule tasks (warning / error level)
For these kind of actions it feels like Moodle's events system is possibly not a perfect fit.
I say this for the following reasons:
1) AFAIK it's not possible to attribute a log level to an event and thus only write to the log if a specific level of sensitivity is required.
2) Events can be subscribed to - all I want to do is log something and not have subscriptions to the event.
3) The moodle log seems traditionally to be based around user activities as opposed to API call failures / etc..
So my thoughts are as follows:
Should it be possible to write to Moodle's log without having to use an event AND should it be possible to set a log level for the entry - i.e info/debug/warning/error/critical ? Is it worth creating a tracker ticket to modify core to allow for this ?
Or for this kind of logging requirement is it best to just roll your own (which I have done in the past using the PHP PSR logger package).
Opinions and thoughts on this would be greatly welcome.