Ticket #460 (closed Feature Request: fixed)
More Flexible Logging for live sites
| Reported by: | OscarB | Owned by: | OscarB |
|---|---|---|---|
| Priority: | minor | Milestone: | 2.2 |
| Component: | Core | Version: | SVN HEAD |
| Keywords: | Logging | Cc: |
Description
I use a modified logging arrangement for live sites. There are occasions when it is helpful to see information in the logs which are essentially notices of varying priority, but not errors.
Currently, we can add notices to logs using Log::add('info', 'something'). The problem for a live site is that superfluous debugging messages are included, which make this impractical.
It is possible to add user notices via Log::add('error', 'something'), and so not fill the logs with debugging, but I prefer to avoid heart attacks by keeping errors as errors.
My suggestion is to add a new logging level, 2, for user 'alert' messages. This requires 2 one line changes in config/log.php and core/Log.php. 'debug' becomes level 3.
Potentially, the 'info' level could be dropped altogether. There are different ways to order the levels, but I think 'debug' should always be last in the order.
I have not added a patch, because this may not be deemed important enough to change, but if the devs agree, I can do the update.
