Skip to content
This repository has been archived by the owner on Nov 16, 2020. It is now read-only.

Commit

Permalink
Use the new rabbit:log_locations/0 API
Browse files Browse the repository at this point in the history
Keys `log_file` and `sasl_log_file` are replaced by a single key
`log_files` which returns a list.

References rabbitmq/rabbitmq-server#94.
  • Loading branch information
dumbbell committed Jan 15, 2016
1 parent f19fc09 commit f602026
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/rabbit_mgmt_external_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
proc_used, proc_total, rates_mode,
uptime, run_queue, processors, exchange_types,
auth_mechanisms, applications, contexts,
log_file, sasl_log_file, db_dir, config_files, net_ticktime,
log_files, db_dir, config_files, net_ticktime,
enabled_plugins, persister_stats]).

%%--------------------------------------------------------------------
Expand Down Expand Up @@ -180,8 +180,7 @@ i(uptime, _State) -> {Total, _} = erlang:statistics(wall_clock),
Total;
i(rates_mode, _State) -> rabbit_mgmt_db_handler:rates_mode();
i(exchange_types, _State) -> list_registry_plugins(exchange);
i(log_file, _State) -> log_location(kernel);
i(sasl_log_file, _State) -> log_location(sasl);
i(log_files, _State) -> [list_to_binary(F) || F <- rabbit:log_locations()];
i(db_dir, _State) -> list_to_binary(rabbit_mnesia:dir());
i(config_files, _State) -> [list_to_binary(F) || F <- rabbit:config_files()];
i(net_ticktime, _State) -> net_kernel:get_net_ticktime();
Expand All @@ -198,12 +197,6 @@ i(applications, _State) ->
[format_application(A) ||
A <- lists:keysort(1, rabbit_misc:which_applications())].

log_location(Type) ->
case rabbit:log_location(Type) of
tty -> <<"tty">>;
File -> list_to_binary(File)
end.

resource_alarm_set(Source) ->
lists:member({{resource_limit, Source, node()},[]},
rabbit_alarm:get_alarms()).
Expand Down

0 comments on commit f602026

Please sign in to comment.