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>DB_ENV->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 7. The DB_LSN Handle" /> 11 <link rel="prev" href="envlog_get_config.html" title="DB_ENV->log_get_config()" /> 12 <link rel="next" href="logput.html" title="DB_ENV->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">DB_ENV->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 7. 23 The DB_LSN 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>DB_ENV->log_printf()</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">#include <db.h> 39 40int 41DB_ENV->log_printf(DB_ENV *env, DB_TXN *txnid, const char *fmt, ...); </pre> 42 <p> 43 The <code class="methodname">DB_ENV->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">DB_ENV->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">DB_ENV->log_printf()</code> <span> 55 <span> 56 method returns a non-zero error value on failure and 0 on success. 57 </span> 58 59 </span> 60 </p> 61 <div class="sect2" lang="en" xml:lang="en"> 62 <div class="titlepage"> 63 <div> 64 <div> 65 <h3 class="title"><a id="id1681890"></a>Parameters</h3> 66 </div> 67 </div> 68 </div> 69 <div class="sect3" lang="en" xml:lang="en"> 70 <div class="titlepage"> 71 <div> 72 <div> 73 <h4 class="title"><a id="id1681704"></a>txnid</h4> 74 </div> 75 </div> 76 </div> 77 <p> 78 If the logged message refers to an application-specified transaction, 79 the <span class="bold"><strong>txnid</strong></span> parameter is a transaction 80 handle returned from <a class="xref" href="txnbegin.html" title="DB_ENV->txn_begin()">DB_ENV->txn_begin()</a>; 81 otherwise NULL. 82 </p> 83 </div> 84 <div class="sect3" lang="en" xml:lang="en"> 85 <div class="titlepage"> 86 <div> 87 <div> 88 <h4 class="title"><a id="id1681995"></a>fmt</h4> 89 </div> 90 </div> 91 </div> 92 <p> 93 A format string that specifies how subsequent arguments (or arguments 94 accessed via the variable-length argument facilities of stdarg(3)) are 95 converted for output. The format string may contain any formatting 96 directives supported by the underlying C library vsnprintf(3) 97 function. 98 </p> 99 </div> 100 </div> 101 <div class="sect2" lang="en" xml:lang="en"> 102 <div class="titlepage"> 103 <div> 104 <div> 105 <h3 class="title"><a id="id1681714"></a>Errors</h3> 106 </div> 107 </div> 108 </div> 109 <p> 110 The <code class="methodname">DB_ENV->log_printf()</code> <span> 111 <span> 112 method may fail and return one of the following non-zero errors: 113 </span> 114 115 </span> 116 </p> 117 <div class="sect3" lang="en" xml:lang="en"> 118 <div class="titlepage"> 119 <div> 120 <div> 121 <h4 class="title"><a id="id1681628"></a>EINVAL</h4> 122 </div> 123 </div> 124 </div> 125 <p> 126 An invalid flag value or parameter was specified. 127 </p> 128 </div> 129 </div> 130 <div class="sect2" lang="en" xml:lang="en"> 131 <div class="titlepage"> 132 <div> 133 <div> 134 <h3 class="title"><a id="id1681629"></a>Class</h3> 135 </div> 136 </div> 137 </div> 138 <p> 139 <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a>, 140 <a class="link" href="logc.html" title="The DB_LOGC Handle">DB_LOGC</a>, 141 <a class="link" href="lsn.html" title="Chapter 7. The DB_LSN Handle">DB_LSN</a> 142 </p> 143 </div> 144 <div class="sect2" lang="en" xml:lang="en"> 145 <div class="titlepage"> 146 <div> 147 <div> 148 <h3 class="title"><a id="id1681964"></a>See Also</h3> 149 </div> 150 </div> 151 </div> 152 <p> 153 <a class="xref" href="lsn.html#loglist" title="Logging Subsystem and Related Methods">Logging Subsystem and Related Methods</a> 154 </p> 155 </div> 156 </div> 157 <div class="navfooter"> 158 <hr /> 159 <table width="100%" summary="Navigation footer"> 160 <tr> 161 <td width="40%" align="left"><a accesskey="p" href="envlog_get_config.html">Prev</a> </td> 162 <td width="20%" align="center"> 163 <a accesskey="u" href="lsn.html">Up</a> 164 </td> 165 <td width="40%" align="right"> <a accesskey="n" href="logput.html">Next</a></td> 166 </tr> 167 <tr> 168 <td width="40%" align="left" valign="top">DB_ENV->log_get_config() </td> 169 <td width="20%" align="center"> 170 <a accesskey="h" href="index.html">Home</a> 171 </td> 172 <td width="40%" align="right" valign="top"> DB_ENV->log_put()</td> 173 </tr> 174 </table> 175 </div> 176 </body> 177</html> 178