aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssl/src/ssl_app.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ssl/src/ssl_app.erl')
-rw-r--r--lib/ssl/src/ssl_app.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/ssl/src/ssl_app.erl b/lib/ssl/src/ssl_app.erl
index 62e8765d4a..d1bd113b0d 100644
--- a/lib/ssl/src/ssl_app.erl
+++ b/lib/ssl/src/ssl_app.erl
@@ -29,9 +29,26 @@
-export([start/2, stop/1]).
start(_Type, _StartArgs) ->
+ start_logger(),
ssl_sup:start_link().
stop(_State) ->
+ stop_logger(),
ok.
+%%
+%% Description: Start SSL logger
+start_logger() ->
+ Config = #{level => info,
+ filter_default => stop,
+ formatter => {logger_ssl_formatter, #{}}},
+ Filter = {fun logger_filters:domain/2,{log,starts_with,[beam,erlang,otp,ssl]}},
+ logger:add_handler(ssl_handler, logger_std_h, Config),
+ logger:add_handler_filter(ssl_handler, filter_non_ssl, Filter).
+
+%%
+%% Description: Stop SSL logger
+stop_logger() ->
+ logger:remove_handler(ssl_handler).
+