Add syslog
This commit is contained in:
parent
6d2b31911a
commit
91eb79967c
3
Makefile
3
Makefile
|
@ -4,7 +4,7 @@ PROJECT = emqx
|
||||||
PROJECT_DESCRIPTION = EMQ X Broker
|
PROJECT_DESCRIPTION = EMQ X Broker
|
||||||
PROJECT_VERSION = 3.0
|
PROJECT_VERSION = 3.0
|
||||||
|
|
||||||
DEPS = jsx gproc gen_rpc lager ekka esockd cowboy clique
|
DEPS = jsx gproc gen_rpc lager ekka esockd cowboy clique lager_syslog
|
||||||
|
|
||||||
dep_jsx = git https://github.com/talentdeficit/jsx 2.9.0
|
dep_jsx = git https://github.com/talentdeficit/jsx 2.9.0
|
||||||
dep_gproc = git https://github.com/uwiger/gproc 0.8.0
|
dep_gproc = git https://github.com/uwiger/gproc 0.8.0
|
||||||
|
@ -14,6 +14,7 @@ dep_esockd = git https://github.com/emqx/esockd emqx30
|
||||||
dep_ekka = git https://github.com/emqx/ekka emqx30
|
dep_ekka = git https://github.com/emqx/ekka emqx30
|
||||||
dep_cowboy = git https://github.com/ninenines/cowboy 2.4.0
|
dep_cowboy = git https://github.com/ninenines/cowboy 2.4.0
|
||||||
dep_clique = git https://github.com/emqx/clique
|
dep_clique = git https://github.com/emqx/clique
|
||||||
|
dep_lager_syslog = git https://github.com/basho/lager_syslog 3.0.1
|
||||||
|
|
||||||
NO_AUTOPATCH = gen_rpc cuttlefish
|
NO_AUTOPATCH = gen_rpc cuttlefish
|
||||||
|
|
||||||
|
|
|
@ -412,7 +412,7 @@ log.syslog = on
|
||||||
## Sets the severity level for syslog.
|
## Sets the severity level for syslog.
|
||||||
##
|
##
|
||||||
## Value: debug | info | notice | warning | error | critical | alert | emergency
|
## Value: debug | info | notice | warning | error | critical | alert | emergency
|
||||||
## log.syslog.level = error
|
log.syslog.level = error
|
||||||
|
|
||||||
##--------------------------------------------------------------------
|
##--------------------------------------------------------------------
|
||||||
## Authentication/Access Control
|
## Authentication/Access Control
|
||||||
|
|
|
@ -442,12 +442,12 @@ end}.
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{mapping, "log.syslog", "lager.handlers", [
|
{mapping, "log.syslog", "lager.handlers", [
|
||||||
%%{default, off},
|
{default, off},
|
||||||
{datatype, flag}
|
{datatype, flag}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{mapping, "log.syslog.identity", "lager.handlers", [
|
{mapping, "log.syslog.identity", "lager.handlers", [
|
||||||
{default, "emqx"},
|
{default, "emqttd"},
|
||||||
{datatype, string}
|
{datatype, string}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
@ -456,10 +456,10 @@ end}.
|
||||||
{datatype, {enum, [daemon, local0, local1, local2, local3, local4, local5, local6, local7]}}
|
{datatype, {enum, [daemon, local0, local1, local2, local3, local4, local5, local6, local7]}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
%%{mapping, "log.syslog.level", "lager.handlers", [
|
{mapping, "log.syslog.level", "lager.handlers", [
|
||||||
%% {default, error},
|
{default, error},
|
||||||
%% {datatype, {enum, [debug, info, notice, warning, error, critical, alert, emergency]}}
|
{datatype, {enum, [debug, info, notice, warning, error, critical, alert, emergency]}}
|
||||||
%%]}.
|
]}.
|
||||||
|
|
||||||
{mapping, "log.error.redirect", "lager.error_logger_redirect", [
|
{mapping, "log.error.redirect", "lager.error_logger_redirect", [
|
||||||
{default, on},
|
{default, on},
|
||||||
|
@ -511,14 +511,13 @@ end}.
|
||||||
both -> [ConsoleHandler, ConsoleFileHandler];
|
both -> [ConsoleHandler, ConsoleFileHandler];
|
||||||
_ -> []
|
_ -> []
|
||||||
end,
|
end,
|
||||||
SyslogHandler = [],
|
SyslogHandler = case cuttlefish:conf_get("log.syslog", Conf) of
|
||||||
%%case cuttlefish:conf_get("log.syslog", Conf, false) of
|
false -> [];
|
||||||
%% false -> [];
|
true -> [{lager_syslog_backend,
|
||||||
%% true -> [{lager_syslog_backend,
|
[cuttlefish:conf_get("log.syslog.identity", Conf),
|
||||||
%% [cuttlefish:conf_get("log.syslog.identity", Conf),
|
cuttlefish:conf_get("log.syslog.facility", Conf),
|
||||||
%% cuttlefish:conf_get("log.syslog.facility", Conf),
|
cuttlefish:conf_get("log.syslog.level", Conf)]}]
|
||||||
%% cuttlefish:conf_get("log.syslog.level", Conf)]}]
|
end,
|
||||||
%%end,
|
|
||||||
ConsoleHandlers ++ ErrorHandler ++ InfoHandler ++ SyslogHandler
|
ConsoleHandlers ++ ErrorHandler ++ InfoHandler ++ SyslogHandler
|
||||||
end
|
end
|
||||||
}.
|
}.
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
{vsn,"3.0"},
|
{vsn,"3.0"},
|
||||||
{modules,[]},
|
{modules,[]},
|
||||||
{registered,[emqx_sup]},
|
{registered,[emqx_sup]},
|
||||||
{applications,[kernel,stdlib,jsx,gproc,gen_rpc,lager,esockd,cowboy
|
{applications,[kernel,stdlib,jsx,gproc,gen_rpc,lager,esockd,
|
||||||
]},
|
cowboy,lager_syslog]},
|
||||||
{env,[]},
|
{env,[]},
|
||||||
{mod,{emqx_app,[]}},
|
{mod,{emqx_app,[]}},
|
||||||
{maintainers,["Feng Lee <feng@emqx.io>"]},
|
{maintainers,["Feng Lee <feng@emqx.io>"]},
|
||||||
|
|
Loading…
Reference in New Issue