<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Thanks Daniel for the explaination !<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I found something in a Kamailio sample script that does what I want to do, e.g. :<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#!ifdef WITH_DEBUG_SCRIPT<o:p></o:p></p>
<p class="MsoNormal">                               xlog("L_INFO", "Request-URI: $ru\n");<o:p></o:p></p>
<p class="MsoNormal">#!endif<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This allows me to log « debug » information from the script as INFO when the flag WITH_DEBUG_SCRIPT is set.<o:p></o:p></p>
<p class="MsoNormal">It’s a bit clumsy but it works. :)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">(I don’t know if having the xlog exported functions changed so they go look at the configuration of the debugger module would be complicated, or even feasible – would be nice though ! ^^)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers!<o:p></o:p></p>
<p class="MsoNormal">Nicolas.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="mso-fareast-language:FR">De :</span></b><span style="mso-fareast-language:FR"> Daniel-Constantin Mierla <miconda@gmail.com>
<br>
<b>Envoyé :</b> jeudi 31 décembre 2020 14:04<br>
<br>
<o:p></o:p></span></p>
</div>
</div>
<p>Hello,<span style="mso-fareast-language:FR"><o:p></o:p></span></p>
<p>the log messages that have "script" in the prefix are from kamailio.cfg routing blocks, not from the C code.<o:p></o:p></p>
<p>You can remove, change their log level, ... by editing the kamailio.cfg. The script log messages are printed by the functions exported from xlog module.<o:p></o:p></p>
<p>Cheers,<br>
Daniel<o:p></o:p></p>
<div>
<p class="MsoNormal">On 30.12.20 18:14, Chaigneau, Nicolas wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Is it possible to set a specific log level for the Kamailio script ?<o:p></o:p></p>
<p class="MsoNormal">I’ve seen that the « debugger » module allows to do that with modules or « core » :<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"><a href="https://kamailio.org/docs/modules/5.4.x/modules/debugger.html#dbg.p.mod_level">https://kamailio.org/docs/modules/5.4.x/modules/debugger.html#dbg.p.mod_level</a><o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">So I’ve tried to do :<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">modparam("debugger", "mod_level_mode", 1)<o:p></o:p></p>
<p class="MsoNormal">modparam("debugger", "mod_hash_size", 5)<o:p></o:p></p>
<p class="MsoNormal">modparam("debugger", "mod_level", "my_module=3") // this works<o:p></o:p></p>
<p class="MsoNormal">modparam("debugger", "mod_level", "core=3") // also works<o:p></o:p></p>
<p class="MsoNormal">modparam("debugger", "mod_level", "script=3") // nope…<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">But it doesn’t seem to work for « script »… :/<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Nicolas.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</blockquote>
</div>
<span style="font-size: 9px; line-height: 10px;">This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.</span></body>
</html>