aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger_proxy.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-12-14 13:05:32 +0100
committerSiri Hansen <[email protected]>2019-01-16 09:59:24 +0100
commit6211cead7be6f0871cfcccccdfc00dbeb466bcf2 (patch)
tree887402465f8a581a83006df906d44668a1baa7ab /lib/kernel/src/logger_proxy.erl
parent2c63eda781ccf12c2f35a94bc07b1b1013232483 (diff)
downloadotp-6211cead7be6f0871cfcccccdfc00dbeb466bcf2.tar.gz
otp-6211cead7be6f0871cfcccccdfc00dbeb466bcf2.tar.bz2
otp-6211cead7be6f0871cfcccccdfc00dbeb466bcf2.zip
[logger] Add API function for configuring logger proxy
Diffstat (limited to 'lib/kernel/src/logger_proxy.erl')
-rw-r--r--lib/kernel/src/logger_proxy.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/kernel/src/logger_proxy.erl b/lib/kernel/src/logger_proxy.erl
index f89891bff0..45a3011828 100644
--- a/lib/kernel/src/logger_proxy.erl
+++ b/lib/kernel/src/logger_proxy.erl
@@ -20,7 +20,7 @@
-module(logger_proxy).
%% API
--export([start_link/0, restart/0, log/2, child_spec/0]).
+-export([start_link/0, restart/0, log/2, child_spec/0, get_default_config/0]).
%% logger_olp callbacks
-export([init/1, handle_load/2, handle_info/2, terminate/2,
@@ -69,11 +69,7 @@ start_link() ->
%%
%% Burst limit is disabled, since this is only a proxy and we
%% don't want to limit bursts twice (here and in the handler).
- Opts = #{sync_mode_qlen=>500,
- drop_mode_qlen=>1000,
- flush_qlen=>5000,
- burst_limit_enable=>false},
- logger_olp:start_link(?SERVER,?MODULE,[],Opts).
+ logger_olp:start_link(?SERVER,?MODULE,[],get_default_config()).
%% Fun used for restarting this process after it has been killed due
%% to overload (must set overload_kill_enable=>true in opts)
@@ -97,6 +93,13 @@ child_spec() ->
type => worker,
modules => [?MODULE]}.
+get_default_config() ->
+ OlpDefault = logger_olp:get_default_opts(),
+ OlpDefault#{sync_mode_qlen=>500,
+ drop_mode_qlen=>1000,
+ flush_qlen=>5000,
+ burst_limit_enable=>false}.
+
%%%===================================================================
%%% gen_server callbacks
%%%===================================================================