fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40384?usp=email )
Change subject: s1ap_proxy: use Global-ENB-ID as logging prefix
......................................................................
s1ap_proxy: use Global-ENB-ID as logging prefix
Change-Id: Ib3584237e60274c0276e750728b2bb2950f376a4
---
M src/s1ap_proxy.erl
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/84/40384/1
diff --git a/src/s1ap_proxy.erl b/src/s1ap_proxy.erl
index 1ebbf7c..85a2e80 100644
--- a/src/s1ap_proxy.erl
+++ b/src/s1ap_proxy.erl
@@ -171,6 +171,11 @@
%% private API
%% ------------------------------------------------------------------
+-spec set_logging_prefix(string()) -> ok.
+set_logging_prefix(Prefix) when is_list(Prefix) ->
+ logger:set_process_metadata(#{prefix => Prefix}).
+
+
-spec erab_uid(erab_id(), proxy_state()) -> erab_uid().
erab_uid(ERABId, #proxy_state{mme_ue_id = MmeUeId,
enb_ue_id = EnbUeId}) ->
@@ -606,12 +611,13 @@
#'Global-ENB-ID'{'pLMNidentity' = PLMNId,
'eNB-ID' = ENBId} = C, S0) ->
%% store PLMNId/ENBId
- %% TODO: use that as a context for logging
S1 = S0#proxy_state{plmn_id = parse_plmn_id(PLMNId),
enb_id = parse_enb_id(ENBId)},
?LOG_INFO("Global-ENB-ID: PLMN-ID=~p, eNB-ID=~p",
[S1#proxy_state.plmn_id,
S1#proxy_state.enb_id]),
+ %% use that as a context for logging
+ set_logging_prefix("eNB " ++ genb_id_str(S1)),
{{ok, C}, S1};
%% E-RAB SETUP REQUEST related IEs
--
To view, visit
https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/40384?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: erlang/osmo-s1gw
Gerrit-Branch: master
Gerrit-Change-Id: Ib3584237e60274c0276e750728b2bb2950f376a4
Gerrit-Change-Number: 40384
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>