Skip to content

Commit a567d98

Browse files
committed
tracer: fix default syslog log level and doc
(cherry picked from commit 0cd20ff)
1 parent b9f9813 commit a567d98

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎modules/tracer/README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ modparam("tracer", "trace_id",
200200
"[tid]uri=file:/path/to/file")
201201
/*syslog trace id at error (level -1)*/
202202
modparam("tracer", "trace_id",
203-
"[tid]uri=syslog:local0:-1")
203+
"[tid]uri=syslog:LOG_LOCAL0:-1")
204204
...
205205
```
206206

@@ -211,6 +211,9 @@ modparam("tracer", "trace_id",
211211
When *syslog* tracing is used, this parameter specifies
212212
the log facility to write traces to.
213213

214+
Facility names must use the OpenSIPS names, such as *LOG_LOCAL0* or
215+
*LOG_DAEMON*. The short form *local0* is not accepted.
216+
214217

215218
*Default value is the value of *syslog_facility*.*
216219

‎modules/tracer/tracer.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,15 @@ static int mod_init(void)
893893

894894
if (trace_default_syslog_facility < 0)
895895
trace_default_syslog_facility = log_facility;
896-
if (trace_default_syslog_level != 0)
896+
if (trace_default_syslog_level == 0)
897897
trace_default_syslog_level = *log_level;
898898

899+
/* update the levels for all tids, if not explicitely set */
900+
for (it = trace_list; it; it = it->next) {
901+
if (it->type == TYPE_SYSLOG && it->el.syslog.level == 0)
902+
it->el.syslog.level = trace_default_syslog_level;
903+
}
904+
899905
LM_INFO("initializing...\n");
900906

901907
trace_on_flag = (int*)shm_malloc(sizeof(int));

0 commit comments

Comments
 (0)