[sr-dev] git:master:73e4dfea: core: logging: JSON: CEE: add the @cee prefix in Syslog messages

Henning Westerholt hw at skalatan.de
Thu Sep 9 21:34:01 CEST 2021


Module: kamailio
Branch: master
Commit: 73e4dfea9b7b21625d029e38f45a07beb2942aff
URL: https://github.com/kamailio/kamailio/commit/73e4dfea9b7b21625d029e38f45a07beb2942aff

Author: Daniel Pocock <daniel at pocock.pro>
Committer: Henning Westerholt <hw at skalatan.de>
Date: 2021-09-09T21:33:56+02:00

core: logging: JSON: CEE: add the @cee prefix in Syslog messages

---

Modified: src/core/dprint.c

---

Diff:  https://github.com/kamailio/kamailio/commit/73e4dfea9b7b21625d029e38f45a07beb2942aff.diff
Patch: https://github.com/kamailio/kamailio/commit/73e4dfea9b7b21625d029e38f45a07beb2942aff.patch

---

diff --git a/src/core/dprint.c b/src/core/dprint.c
index 4a6dac31ca..1a809710ae 100644
--- a/src/core/dprint.c
+++ b/src/core/dprint.c
@@ -652,6 +652,10 @@ static void ksr_slog_json_str_escape(str *s_in, str *s_out, int *emode)
         "\"file\":{\"name\":\"%s\",\"line\":%d},\"native\":{\"function\":\"%s\"},\"msg\":\"%s\"," \
         "\"pname\":\"%s\",\"appname\":\"%s\",\"hostname\":\"%s\"}%s"
 
+#define KSR_SLOG_SYSLOG_JSON_CEEFMT "@cee: " KSR_SLOG_JSON_CEEFMT
+
+#define KSR_SLOG_STDERR_JSON_CEEFMT KSR_SLOG_JSON_CEEFMT
+
 void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
 {
 	va_list arglist;
@@ -718,7 +722,7 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
 	strftime (iso8601buf, ISO8601_BUF_SIZE, "%FT%T", &_tm);
 	if (unlikely(log_stderr)) {
 		if (unlikely(log_cee)) {
-			fprintf(stderr, KSR_SLOG_JSON_CEEFMT,
+			fprintf(stderr, KSR_SLOG_STDERR_JSON_CEEFMT,
 			iso8601buf, _tp.tv_nsec, my_pid(),
 #ifdef HAVE_PTHREAD
                         (uintmax_t)pthread_self(),
@@ -739,7 +743,7 @@ void ksr_slog_json(ksr_logdata_t *kld, const char *format, ...)
 		}
 	} else {
 		if (unlikely(log_cee)) {
-			_km_log_func(kld->v_facility, KSR_SLOG_JSON_CEEFMT,
+			_km_log_func(kld->v_facility, KSR_SLOG_SYSLOG_JSON_CEEFMT,
 			iso8601buf, _tp.tv_nsec, my_pid(),
 #ifdef HAVE_PTHREAD
                         pthread_self(),




More information about the sr-dev mailing list