1<?xml version="1.0" encoding="UTF-8" standalone="no"?> 2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3<html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 6 <title>DbEnv::log_printf()</title> 7 <link rel="stylesheet" href="apiReference.css" type="text/css" /> 8 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> 9 <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" /> 10 <link rel="up" href="lsn.html" title="Chapter 8. The DbLsn Handle" /> 11 <link rel="prev" href="envlog_get_config.html" title="DbEnv::log_get_config()" /> 12 <link rel="next" href="logput.html" title="DbEnv::log_put()" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">DbEnv::log_printf()</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="envlog_get_config.html">Prev</a> </td> 22 <th width="60%" align="center">Chapter 8. 23 The DbLsn Handle 24 </th> 25 <td width="20%" align="right"> <a accesskey="n" href="logput.html">Next</a></td> 26 </tr> 27 </table> 28 <hr /> 29 </div> 30 <div class="sect1" lang="en" xml:lang="en"> 31 <div class="titlepage"> 32 <div> 33 <div> 34 <h2 class="title" style="clear: both"><a id="logprintf"></a>DbEnv::log_printf()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db_cxx.h> 39 40int 41DbEnv::log_printf(DB_TXN *txnid, const char *fmt, ...);</pre> 42 <p> 43 The <code class="methodname">DbEnv::log_printf()</code> method appends an informational message to 44 the Berkeley DB database environment log files. 45 </p> 46 <p> 47 The <code class="methodname">DbEnv::log_printf()</code> method allows applications to include 48 information in the database environment log files, for later review 49 using the <a class="link" href="db_printlog.html" title="db_printlog">db_printlog</a> 50 utility. This method is intended for debugging and performance 51 tuning. 52 </p> 53 <p> 54 The <code class="methodname">DbEnv::log_printf()</code> <span> 55 56 <span> 57 method either returns a non-zero error value or throws an 58 exception that encapsulates a non-zero error value on 59 failure, and returns 0 on success. 60 </span> 61 </span> 62 </p> 63 <div class="sect2" lang="en" xml:lang="en"> 64 <div class="titlepage"> 65 <div> 66 <div> 67 <h3 class="title"><a id="id1685976"></a>Parameters</h3> 68 </div> 69 </div> 70 </div> 71 <div class="sect3" lang="en" xml:lang="en"> 72 <div class="titlepage"> 73 <div> 74 <div> 75 <h4 class="title"><a id="id1685651"></a>txnid</h4> 76 </div> 77 </div> 78 </div> 79 <p> 80 If the logged message refers to an application-specified transaction, 81 the <span class="bold"><strong>txnid</strong></span> parameter is a transaction 82 handle returned from <a class="xref" href="txnbegin.html" title="DbEnv::txn_begin()">DbEnv::txn_begin()</a>; 83 otherwise NULL. 84 </p> 85 </div> 86 <div class="sect3" lang="en" xml:lang="en"> 87 <div class="titlepage"> 88 <div> 89 <div> 90 <h4 class="title"><a id="id1686118"></a>fmt</h4> 91 </div> 92 </div> 93 </div> 94 <p> 95 A format string that specifies how subsequent arguments (or arguments 96 accessed via the variable-length argument facilities of stdarg(3)) are 97 converted for output. The format string may contain any formatting 98 directives supported by the underlying C library vsnprintf(3) 99 function. 100 </p> 101 </div> 102 </div> 103 <div class="sect2" lang="en" xml:lang="en"> 104 <div class="titlepage"> 105 <div> 106 <div> 107 <h3 class="title"><a id="id1686119"></a>Errors</h3> 108 </div> 109 </div> 110 </div> 111 <p> 112 The <code class="methodname">DbEnv::log_printf()</code> <span> 113 114 <span> 115 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 116 exception, encapsulating one of the following non-zero errors, or return one 117 of the following non-zero errors: 118 </span> 119 </span> 120 </p> 121 <div class="sect3" lang="en" xml:lang="en"> 122 <div class="titlepage"> 123 <div> 124 <div> 125 <h4 class="title"><a id="id1685525"></a>EINVAL</h4> 126 </div> 127 </div> 128 </div> 129 <p> 130 An invalid flag value or parameter was specified. 131 </p> 132 </div> 133 </div> 134 <div class="sect2" lang="en" xml:lang="en"> 135 <div class="titlepage"> 136 <div> 137 <div> 138 <h3 class="title"><a id="id1685526"></a>Class</h3> 139 </div> 140 </div> 141 </div> 142 <p> 143 <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a>, 144 <a class="link" href="logc.html" title="The DbLogc Handle">DbLogc</a>, 145 <a class="link" href="lsn.html" title="Chapter 8. The DbLsn Handle">DbLsn</a> 146 </p> 147 </div> 148 <div class="sect2" lang="en" xml:lang="en"> 149 <div class="titlepage"> 150 <div> 151 <div> 152 <h3 class="title"><a id="id1685991"></a>See Also</h3> 153 </div> 154 </div> 155 </div> 156 <p> 157 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a> 158 </p> 159 </div> 160 </div> 161 <div class="navfooter"> 162 <hr /> 163 <table width="100%" summary="Navigation footer"> 164 <tr> 165 <td width="40%" align="left"><a accesskey="p" href="envlog_get_config.html">Prev</a> </td> 166 <td width="20%" align="center"> 167 <a accesskey="u" href="lsn.html">Up</a> 168 </td> 169 <td width="40%" align="right"> <a accesskey="n" href="logput.html">Next</a></td> 170 </tr> 171 <tr> 172 <td width="40%" align="left" valign="top">DbEnv::log_get_config() </td> 173 <td width="20%" align="center"> 174 <a accesskey="h" href="index.html">Home</a> 175 </td> 176 <td width="40%" align="right" valign="top"> DbEnv::log_put()</td> 177 </tr> 178 </table> 179 </div> 180 </body> 181</html> 182