|
@@ -11,9 +11,9 @@ Elena-Ramona Modroiu
|
|
|
|
|
|
<[email protected]>
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2003 FhG FOKUS
|
|
|
|
|
|
+ Copyright © 2003 FhG FOKUS
|
|
|
|
|
|
- Copyright © 2008-2010 Elena-Ramona Modroiu
|
|
|
|
|
|
+ Copyright © 2008-2010 Elena-Ramona Modroiu
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -34,6 +34,7 @@ Elena-Ramona Modroiu
|
|
4.3. long_format (integer)
|
|
4.3. long_format (integer)
|
|
4.4. prefix (str)
|
|
4.4. prefix (str)
|
|
4.5. log_facility (string)
|
|
4.5. log_facility (string)
|
|
|
|
+ 4.6. log_colors (string)
|
|
|
|
|
|
5. Functions
|
|
5. Functions
|
|
|
|
|
|
@@ -49,8 +50,9 @@ Elena-Ramona Modroiu
|
|
1.3. Set long_format parameter
|
|
1.3. Set long_format parameter
|
|
1.4. Set prefix parameter
|
|
1.4. Set prefix parameter
|
|
1.5. log_facility example
|
|
1.5. log_facility example
|
|
- 1.6. xlog usage
|
|
|
|
- 1.7. xdbg usage
|
|
|
|
|
|
+ 1.6. log_colors example
|
|
|
|
+ 1.7. xlog usage
|
|
|
|
+ 1.8. xdbg usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
Chapter 1. Admin Guide
|
|
|
|
|
|
@@ -70,6 +72,7 @@ Chapter 1. Admin Guide
|
|
4.3. long_format (integer)
|
|
4.3. long_format (integer)
|
|
4.4. prefix (str)
|
|
4.4. prefix (str)
|
|
4.5. log_facility (string)
|
|
4.5. log_facility (string)
|
|
|
|
+ 4.6. log_colors (string)
|
|
|
|
|
|
5. Functions
|
|
5. Functions
|
|
|
|
|
|
@@ -83,7 +86,7 @@ Chapter 1. Admin Guide
|
|
This module provides the possibility to print user formatted log or
|
|
This module provides the possibility to print user formatted log or
|
|
debug messages from Kamailio scripts, similar to the printf function. A
|
|
debug messages from Kamailio scripts, similar to the printf function. A
|
|
C-style printf specifier is replaced with a part of the SIP request or
|
|
C-style printf specifier is replaced with a part of the SIP request or
|
|
- other variables from system. Section 2, "Implemented Specifiers" shows
|
|
|
|
|
|
+ other variables from system. Section 2, “Implemented Specifiers� shows
|
|
what can be printed out.
|
|
what can be printed out.
|
|
|
|
|
|
2. Implemented Specifiers
|
|
2. Implemented Specifiers
|
|
@@ -126,6 +129,7 @@ Chapter 1. Admin Guide
|
|
4.3. long_format (integer)
|
|
4.3. long_format (integer)
|
|
4.4. prefix (str)
|
|
4.4. prefix (str)
|
|
4.5. log_facility (string)
|
|
4.5. log_facility (string)
|
|
|
|
+ 4.6. log_colors (string)
|
|
|
|
|
|
4.1. buf_size (integer)
|
|
4.1. buf_size (integer)
|
|
|
|
|
|
@@ -184,6 +188,22 @@ modparam("xlog", "prefix", "-xlog: ")
|
|
Example 1.5. log_facility example
|
|
Example 1.5. log_facility example
|
|
modparam("xlog", "log_facility", "LOG_DAEMON")
|
|
modparam("xlog", "log_facility", "LOG_DAEMON")
|
|
|
|
|
|
|
|
+4.6. log_colors (string)
|
|
|
|
+
|
|
|
|
+ Update terminal colors used by core for log levels (when log_stderr=1
|
|
|
|
+ and log_color=1). The value has to be 'logname=colors', where colors is
|
|
|
|
+ two characters specifying foreground and background in the same format
|
|
|
|
+ as $C(xy) variable.
|
|
|
|
+
|
|
|
|
+ The parameter can be set many times, its value can also be a
|
|
|
|
+ ';'-separated list of color specs.
|
|
|
|
+
|
|
|
|
+ Default value is NULL.
|
|
|
|
+
|
|
|
|
+ Example 1.6. log_colors example
|
|
|
|
+modparam("xlog", "log_colors", "L_ERR=cr")
|
|
|
|
+modparam("xlog", "log_colors", "L_ERR=cr;L_WARN=px")
|
|
|
|
+
|
|
5. Functions
|
|
5. Functions
|
|
|
|
|
|
5.1. xlog([ [facility,] level,] format)
|
|
5.1. xlog([ [facility,] level,] format)
|
|
@@ -191,7 +211,7 @@ modparam("xlog", "log_facility", "LOG_DAEMON")
|
|
5.3. xlogl([ [facility,] level,] format)
|
|
5.3. xlogl([ [facility,] level,] format)
|
|
5.4. xdbgl(format)
|
|
5.4. xdbgl(format)
|
|
|
|
|
|
-5.1. xlog([ [facility,] level,] format)
|
|
|
|
|
|
+5.1. xlog([ [facility,] level,] format)
|
|
|
|
|
|
Print a formated message using LOG function.
|
|
Print a formated message using LOG function.
|
|
|
|
|
|
@@ -214,13 +234,13 @@ modparam("xlog", "log_facility", "LOG_DAEMON")
|
|
See above options for valid log levels.
|
|
See above options for valid log levels.
|
|
If it is not a pseudo-variable, then what really matters is the
|
|
If it is not a pseudo-variable, then what really matters is the
|
|
third letter of the value. If the log level is higher than the
|
|
third letter of the value. If the log level is higher than the
|
|
- "debug" global parameter, the message is not printed to syslog.
|
|
|
|
|
|
+ “debug� global parameter, the message is not printed to syslog.
|
|
If this parameter is missing, the implicit log level is 'L_ERR'.
|
|
If this parameter is missing, the implicit log level is 'L_ERR'.
|
|
* format - The formatted string to be printed.
|
|
* format - The formatted string to be printed.
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.6. xlog usage
|
|
|
|
|
|
+ Example 1.7. xlog usage
|
|
...
|
|
...
|
|
xlog("L_ERR", "time [$Tf] method ($rm) r-uri ($ru) 2nd via ($hdr(via[1]))\n");
|
|
xlog("L_ERR", "time [$Tf] method ($rm) r-uri ($ru) 2nd via ($hdr(via[1]))\n");
|
|
...
|
|
...
|
|
@@ -233,7 +253,7 @@ xlog("LOG_LOCAL3", "L_ERR", "this message will be sent to syslog facility LOG_LO
|
|
CAL3\n");
|
|
CAL3\n");
|
|
...
|
|
...
|
|
|
|
|
|
-5.2. xdbg(format)
|
|
|
|
|
|
+5.2. xdbg(format)
|
|
|
|
|
|
Print a formatted message using DBG function.
|
|
Print a formatted message using DBG function.
|
|
|
|
|
|
@@ -242,17 +262,17 @@ CAL3\n");
|
|
|
|
|
|
This function can be used from ANY_ROUTE.
|
|
This function can be used from ANY_ROUTE.
|
|
|
|
|
|
- Example 1.7. xdbg usage
|
|
|
|
|
|
+ Example 1.8. xdbg usage
|
|
...
|
|
...
|
|
xdbg("time $Cbx[$Tf]$Cxx method ($rm) r-uri ($ru)\n");
|
|
xdbg("time $Cbx[$Tf]$Cxx method ($rm) r-uri ($ru)\n");
|
|
...
|
|
...
|
|
|
|
|
|
-5.3. xlogl([ [facility,] level,] format)
|
|
|
|
|
|
+5.3. xlogl([ [facility,] level,] format)
|
|
|
|
|
|
Similar to xlog(), in addition is printing cfg line number at the
|
|
Similar to xlog(), in addition is printing cfg line number at the
|
|
beginning of message.
|
|
beginning of message.
|
|
|
|
|
|
-5.4. xdbgl(format)
|
|
|
|
|
|
+5.4. xdbgl(format)
|
|
|
|
|
|
Similar to xdbg(), in addition is printing cfg line number at the
|
|
Similar to xdbg(), in addition is printing cfg line number at the
|
|
beginning of message.
|
|
beginning of message.
|