2017-06-12 19:44:06 +02:00
|
|
|
[
|
|
|
|
{ log_monitor,
|
|
|
|
[
|
2017-07-03 15:35:43 +02:00
|
|
|
{general,
|
|
|
|
[
|
|
|
|
%% Command to watch the log files.
|
|
|
|
{tail_cmd, "/usr/bin/tail -n0 --follow=name"},
|
|
|
|
|
|
|
|
%% How long to gather log lines after an error occurs.
|
|
|
|
%% If another error occurs, the time is reset.
|
|
|
|
{gathering_time, 1000},
|
|
|
|
|
|
|
|
%% Max time for gathering log lines.
|
|
|
|
%% Precaution in case of infinite consecutive errors.
|
|
|
|
{max_gathering_time, 30000}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2017-06-12 19:44:06 +02:00
|
|
|
{email_config,
|
|
|
|
[
|
|
|
|
{sender, "log@monitor.com"},
|
2017-07-02 11:53:21 +02:00
|
|
|
|
|
|
|
%% The receiver to use for all the groups that do not specify any receiver.
|
2017-06-12 19:44:06 +02:00
|
|
|
{default_receiver, "salvini.fabio001@gmail.com"},
|
2017-07-02 11:53:21 +02:00
|
|
|
|
|
|
|
%% The receiver to use for the application errors.
|
|
|
|
{admin_receiver, "salvini.fabio001@gmail.com"},
|
|
|
|
|
2017-06-26 16:27:53 +02:00
|
|
|
%% Subject of the email.
|
|
|
|
%% Placeholders:
|
|
|
|
%% %f: the full path of the log file (ex. /var/log/myapp.log).
|
|
|
|
%% %F: the basename of the log file (ex. myapp).
|
2017-07-04 21:21:15 +02:00
|
|
|
%% %l: the first error line.
|
2017-06-26 16:27:53 +02:00
|
|
|
{subject, "[%F] Error notification"},
|
2017-07-02 11:53:21 +02:00
|
|
|
|
2017-06-12 19:44:06 +02:00
|
|
|
{connection, [
|
2017-07-04 21:21:15 +02:00
|
|
|
{relay, "smtp.nodomain.com"},
|
|
|
|
{username, ""},
|
2017-06-12 19:44:06 +02:00
|
|
|
{password, ""}]
|
|
|
|
}
|
|
|
|
]
|
2017-07-01 19:57:03 +02:00
|
|
|
},
|
2017-07-02 11:53:21 +02:00
|
|
|
|
|
|
|
%% Location of the file that contains the logs to monitor.
|
2017-07-01 19:57:03 +02:00
|
|
|
{logfiles_config, "/home/fsalvini/gitRepos/log_monitor/config/logfiles.config"}
|
2017-06-12 19:44:06 +02:00
|
|
|
]
|
2017-06-15 23:40:27 +02:00
|
|
|
},
|
2017-07-02 11:53:21 +02:00
|
|
|
|
2017-06-15 23:40:27 +02:00
|
|
|
%% Directory where the application data is stored.
|
|
|
|
%% WARNING: If you leave it inside /tmp, every time the node is restarted the
|
|
|
|
%% application will reset.
|
|
|
|
{ mnesia , [
|
|
|
|
{dir, "/tmp/mnesia"}
|
|
|
|
]
|
2017-06-12 19:44:06 +02:00
|
|
|
}
|
|
|
|
].
|