1
%% ``The contents of this file are subject to the Erlang Public License,
2
%% Version 1.1, (the "License"); you may not use this file except in
3
%% compliance with the License. You should have received a copy of the
4
%% Erlang Public License along with this software. If not, it can be
5
%% retrieved via the world wide web at http://www.erlang.org/.
7
%% Software distributed under the License is distributed on an "AS IS"
8
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
%% the License for the specific language governing rights and limitations
12
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
%% AB. All Rights Reserved.''
20
-behaviour(supervisor).
22
-define(LogServer, {log_server,
23
{log_server, start_link, []},
24
permanent, 2000, worker, [log_server]}).
26
-define(LogSnmp, {log_snmp,
27
{log_snmp, start_link, []},
28
permanent, 2000, worker, [log_snmp]}).
31
-export([start_link/1, start_link/3]).
36
%%-----------------------------------------------------------------
37
%% Convinent supervisor to use for LOG, with or without snmp
39
%%-----------------------------------------------------------------
40
start_link(DefaultLog) ->
41
supervisor:start_link({local, eva_log_sup}, ?MODULE, DefaultLog).
42
start_link(DefaultLog, LogDir, MaxDirSize) ->
43
supervisor:start_link({local, eva_log_sup}, ?MODULE,
44
{DefaultLog, LogDir, MaxDirSize}).
46
init({DefaultLog, LogDir, MaxDirSize}) ->
47
SupFlags = {rest_for_one, 4, 3600},
48
EvaLogH = {eva_log_h_sup,
49
{eva_log, start_link, [DefaultLog]},
50
permanent, 2000, worker, [eva_log]},
51
EvaLogSnmp = {eva_log_snmp,
52
{eva_log_snmp, start_link, [LogDir, MaxDirSize]},
53
permanent, 2000, worker, [eva_log_snmp]},
54
{ok, {SupFlags, [?LogServer, EvaLogH, ?LogSnmp, EvaLogSnmp]}};
57
SupFlags = {rest_for_one, 4, 3600},
58
EvaLogH = {eva_log_h_sup,
59
{eva_log, start_link, [DefaultLog]},
60
permanent, 2000, worker, [eva_log]},
61
{ok, {SupFlags, [?LogServer, EvaLogH]}}.