| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.20"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>Qpid Proton C API: Logging</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtreedata.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(document).ready(function() { init_search(); }); |
| /* @license-end */ |
| </script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <td id="projectalign" style="padding-left: 0.5em;"> |
| <div id="projectname">Qpid Proton C API |
|  <span id="projectnumber">0.32.0</span> |
| </div> |
| </td> |
| <td> <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.svg" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a> |
| </span> |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.20 --> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| /* @license-end */ |
| </script> |
| </div><!-- top --> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| <div id="nav-sync" class="sync"></div> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| $(document).ready(function(){initNavTree('logging.html',''); initResizable(); }); |
| /* @license-end */ |
| </script> |
| <div id="doc-content"> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| </div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| <div class="PageDoc"><div class="header"> |
| <div class="headertitle"> |
| <div class="title">Logging </div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <div class="textblock"><p><a class="anchor" id="md__tmp_rgemmell_transom_qpid-proton-0"></a>.32.0_c_docs_logging</p> |
| <h2><a class="anchor" id="autotoc_md13"></a> |
| Backward compatible logging control</h2> |
| <p>Proton has always supported some control over its internal logging using environment variables. The one that has seen the most use is <code>PN_TRACE_FRM</code> which when set to '1', 'on' or 'true' turns on logging of protocol frame traces. This is commonly used on a Unix shell command line like so: </p><pre class="fragment">PN_TRACE_FRM=1 ./proton_program |
| </pre><p>Setting <code>PN_TRACE_FRM</code> is equivalent to using the <a class="el" href="group__logger.html#ggacff7629aa49e187a5e6182b80febabf1a07ed98e7988f169c5c7282bfd3a82c63">PN_LEVEL_FRAME</a> log level setting in the proton <a class="el" href="group__logger.html">Logger</a> API.</p> |
| <p>There are several other (less used) environment variables which are supported:</p> |
| <ul> |
| <li><code>PN_TRACE_RAW</code> - This turns on raw protocol frame tracing and is equivalent to <a class="el" href="group__logger.html#ggacff7629aa49e187a5e6182b80febabf1a6a26f859bdc36ee208a7594067219b27">PN_LEVEL_RAW</a>.</li> |
| <li><code>PN_TRACE_EVT</code> - This is useful for tracing events, but has no direct equivalent in the Logger API.</li> |
| <li><code>PN_TRACE_DRV</code> - This turns on very verbose miscellaneous tracing, again it has no direct equivalent in the Logger API.</li> |
| </ul> |
| <p>The last two variables are still supported, but their effect may not be to turn on exactly the same logging messages as prior to the introduction of the Logger API.</p> |
| <h2><a class="anchor" id="autotoc_md14"></a> |
| Logger control introduced with the logger API</h2> |
| <p>The <a class="el" href="group__logger.html">Logger</a> API uses a single environment variable to control the default logging state - <code>PN_LOG</code>. This can include a number of strings which correspond to log levels to turn on, these are in descending order of importance (case is not significant):</p> |
| <ul> |
| <li>Error</li> |
| <li>Warning</li> |
| <li>Info</li> |
| <li>Debug</li> |
| <li>Trace</li> |
| </ul> |
| <p>These strings can also be suffixed with '+' to mean this level and all the ones above. So specifying 'Info+' means turn on 'Error', 'Warning' and 'Info' levels. For example: </p><pre class="fragment">PN_LOG='info+' ./broker |
| </pre><ul> |
| <li>Frame</li> |
| <li>Raw</li> |
| </ul> |
| <p>These strings are equivalent to the frame and raw frame protocol traces from <code>PN_TRACE_FRM</code> and <code>PN_TRACE_RAW</code>, they will ignore any '+' appended to them. For example: </p><pre class="fragment">PN_LOG='frame' ./proton_program |
| </pre><p>will have the same effect as the first example in this document.</p> |
| <ul> |
| <li>All</li> |
| </ul> |
| <p>This will turn all known logging levels on. This is probably hardly ever useful as it will produce huge amounts of output. Appending '+' will again have no effect as all logging is already turned on!</p> |
| <p>Multiple specifiers can be in the string for more logging levels: </p><pre class="fragment">PN_LOG='error frame' ./proton_program |
| </pre><p>this would be useful to see the frame trace logged together with any errors. </p> |
| </div></div><!-- contents --> |
| </div><!-- PageDoc --> |
| </div><!-- doc-content --> |
| <!-- start footer part --> |
| <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| <ul> |
| <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li> |
| </ul> |
| </div> |
| </body> |
| </html> |