summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_log.erl7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/rabbit_log.erl b/src/rabbit_log.erl
index f60336a1..2ca5260c 100644
--- a/src/rabbit_log.erl
+++ b/src/rabbit_log.erl
@@ -61,7 +61,12 @@ error(Fmt) -> log(default, error, Fmt).
error(Fmt, Args) -> log(default, error, Fmt, Args).
catlevel(Category) ->
- {ok, CatLevelList} = application:get_env(rabbit, log_levels),
+ %% We can get here as part of rabbitmqctl when it is impersonating
+ %% a node; in which case the env will not be defined.
+ CatLevelList = case application:get_env(rabbit, log_levels) of
+ {ok, L} -> L;
+ undefined -> []
+ end,
level(proplists:get_value(Category, CatLevelList, info)).
%%--------------------------------------------------------------------