Ticket #460 (closed Feature Request: fixed)

Opened 6 months ago

Last modified 4 months ago

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.

Change History

Changed 5 months ago by Igor

Add new level and some config variables.

This level for production site's. What important:

1) write all php errors to log files

2) don't show error site visitors

3) mail notify admin

I use CodeIgniter. Create some hacks for this feature. Very convenient.

Example: New level: 'mail' 'production_error'. What's means.

$config['threshold'] = 4;
$config['display_errors'] = FALSE; // or set auto

$config['mail'] = example [dot] example com;

Write errors to file and send it to mail.

Changed 4 months ago by Shadowhand

  • owner changed from Shadowhand to OscarB

Changed 4 months ago by Shadowhand

Fixed in r2653. (Closing for Oscar, he can't use Trac)

Changed 4 months ago by Shadowhand

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.