1<!--$Id: log_file.so,v 10.34 2004/08/13 03:38:57 bostic Exp $-->
2<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
3<!--See the file LICENSE for redistribution information.-->
4<html>
5<head>
6<title>Berkeley DB: DbEnv::log_file</title>
7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
9</head>
10<body bgcolor=white>
11<table width="100%"><tr valign=top>
12<td>
13<b>DbEnv::log_file</b>
14</td>
15<td align=right>
16<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a>
17<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
18</tr></table>
19<hr size=1 noshade>
20<tt>
21<b><pre>
22#include &lt;db_cxx.h&gt;
23<p>
24int
25DbEnv::log_file(const DbLsn *lsn, char *namep, size_t len);
26</pre></b>
27<hr size=1 noshade>
28<b>Description: DbEnv::log_file</b>
29<p>The DbEnv::log_file method maps
30<a href="../api_cxx/lsn_class.html">DbLsn</a> objects
31to filenames, returning the name of the file containing the record named
32by <b>lsn</b>.</p>
33<p>This mapping of
34<a href="../api_cxx/lsn_class.html">DbLsn</a> objects
35to files is needed for database administration.  For example, a
36transaction manager typically records the earliest <a href="../api_cxx/lsn_class.html">DbLsn</a> needed
37for restart, and the database administrator may want to archive log
38files to tape when they contain only <a href="../api_cxx/lsn_class.html">DbLsn</a> entries before the
39earliest one needed for restart.</p>
40<p>The DbEnv::log_file method
41either returns a non-zero error value
42or throws an exception that encapsulates a non-zero error value on
43failure, and returns 0 on success.
44</p>
45<b>Parameters</b> <br>
46 <b>lsn</b><ul compact><li>The <b>lsn</b> parameter is the
47<a href="../api_cxx/lsn_class.html">DbLsn</a> object
48for which a filename is wanted.</ul>
49 <b>namep</b><ul compact><li>The <b>namep</b> parameter references memory into which
50 the name of the file containing the record named by <b>lsn</b> is copied.</ul> 
51 <b>len</b><ul compact><li>The <b>len</b> parameter is the length of the <b>namep</b> buffer in
52bytes.  If <b>namep</b> is too short to hold the filename,
53DbEnv::log_file will fail.  (Log filenames are normally quite short,
54on the order of 10 characters.)</ul>
55<br>
56<br><b>Errors</b>
57<p>The DbEnv::log_file method
58may fail and throw
59<a href="../api_cxx/except_class.html">DbException</a>,
60encapsulating one of the following non-zero errors, or return one of
61the following non-zero errors:</p>
62<br>
63<b>EINVAL</b><ul compact><li>If supplied buffer was too small to hold the log filename; or if an
64invalid flag value or parameter was specified.</ul>
65<br>
66<hr size=1 noshade>
67<br><b>Class</b>
68<a href="../api_cxx/env_class.html">DbEnv</a>, <a href="../api_cxx/logc_class.html">DbLogc</a>, <a href="../api_cxx/lsn_class.html">DbLsn</a>
69<br><b>See Also</b>
70<a href="../api_cxx/log_list.html">Logging Subsystem and Related Methods</a>
71</tt>
72<table width="100%"><tr><td><br></td><td align=right>
73<a href="../api_cxx/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
74</td></tr></table>
75<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
76</body>
77</html>
78