﻿ticket,summary,type,release,owner,status,created,modified,_description,_reporter
11985,Periodically checks of log,enhancement,1.0,Franz,new,2014-09-17T15:41:11+02:00,2014-09-17T15:41:11+02:00,"Periodically checks of log would be very useful. This means log-files are checked periodically (e.g. every 120 seconds) for any search pattern.

''Example Use Case'':
When there is an Exception, leave a comment in a specific ticket; within this ticket users can add themselfs as ""CC"", so they will be automatically informed by email (if email is configured correctly).

Needed configuration in `trac.ini`:
{{{#!ini
[logwatcher]
# check interval in seconds, defaults to 120; 0 deactivates periodical checks
check_interval = 120
# amount of failures before entry will be deactivated
failure_limit = 10
}}}

Needed table:
{{{#!sql
create table logwatcher (
  id serial,
  name text,
  log_destination text,
  search_pattern text,
  is_regex bool,
  is_casesens bool,
  surround_lines int,
  last_check timestamp,
  last_line int,
  ticket bigint,
  active bool,
  failures int
);
}}}

Description of table `logwatcher`:
- `ticket`: if ticket ID is specified, leave comment at ticket; ''opt'': if it is null, create new ticket
- `failures`: if it has failed to execute search (e.g. ticket ID is not valid, file not found, etc.), increase failures; when failures reach a specific amout (e.g. 10) deactivate this entry
",Franz
