xlog Module Elena-Ramona Modroiu FhG FOKUS Edited by Elena-Ramona Modroiu Copyright © 2003 FhG FOKUS _________________________________________________________ Table of Contents 1. User's Guide 1.1. Overview 1.2. Implemented Specifiers 1.3. Dependencies 1.3.1. SER Modules 1.3.2. External Libraries or Applications 1.4. Exported Parameters 1.4.1. buf_size (integer) 1.5. Exported Functions 1.5.1. xlog(level, format) 1.5.2. xdbg(format) 2. Developer's Guide 3. Frequently Asked Questions List of Examples 1-1. Set buf_size parameter 1-2. xlog usage 1-3. xdbg usage _________________________________________________________ Chapter 1. User's Guide 1.1. Overview This module provides the possibility to print user formatted log or debug messages from SER scripts, similar to printf function but now a specifier is replaced with a part of the SIP request. Section 1.2 shows what can be printed out. _________________________________________________________ 1.2. Implemented Specifiers * %% : '%' * %Ts : unix time stamp * %Tf : string formatted time * %ci : call-id * %cs : cseq * %ct : contact header * %fu : 'From' uri * %ft : 'From' tag * %rm : request's method * %ru : request's r-uri * %rr : reply's reason * %rs : reply's status * %tu : 'To' uri * %tt : 'To' tag * %mi : SIP message id * %pp : process id (pid) * %is : IP source address _________________________________________________________ 1.3. Dependencies 1.3.1. SER Modules The following modules must be loaded before this module: * No dependencies on other SER modules. _________________________________________________________ 1.3.2. External Libraries or Applications The following libraries or applications must be installed before running SER with this module loaded: * None. _________________________________________________________ 1.4. Exported Parameters 1.4.1. buf_size (integer) Maximum size of the log message. Default value is 4096. Example 1-1. Set buf_size parameter ... modparam("xlog", "buf_size", 8192) ... _________________________________________________________ 1.5. Exported Functions 1.5.1. xlog(level, format) Print a formated message using LOG function. Meaning of the parameters is as follows: * level - The level that will be used in LOG function. It can be: + L_ALERT + L_CRIT + L_ERR + L_WARN + L_NOTICE + L_INFO + L_DBG What really matters is the third letter of the value. * format - The formatted string to be printed. Example 1-2. xlog usage ... xlog("L_ERR", "time [%Tf] method <%rm> r-uri <%ru>\n"); ... _________________________________________________________ 1.5.2. xdbg(format) Print a formatted message using DBG function. Meaning of the parameters is as follows: * format - The formatted string to be printed. Example 1-3. xdbg usage ... xdbg("time [%Tf] method <%rm> r-uri <%ru>\n"); ... _________________________________________________________ Chapter 2. Developer's Guide The module does not provide any sort of API to use in other SER modules. _________________________________________________________ Chapter 3. Frequently Asked Questions 3.1. Where can I find more about SER? 3.2. Where can I post a question about this module? 3.3. How can I report a bug? 3.1. Where can I find more about SER? Take a look at http://iptel.org/ser. 3.2. Where can I post a question about this module? First at all check if your question was already answered on one of our mailing lists: * http://mail.iptel.org/mailman/listinfo/serusers * http://mail.iptel.org/mailman/listinfo/serdev E-mails regarding any stable version should be sent to and e-mail regarding development versions or CVS snapshots should be send to . If you want to keep the mail private, send it to . 3.3. How can I report a bug? Please follow the guidelines provided at: http://iptel.org/ser/bugs