### Db::set_msgfile |

`

###

    #include <db_cxx.h>

    void Db::set_msgfile(FILE *msgfile);

    void Db::get_msgfile(FILE **msgfilep);

### Description: Db::set_msgfile

There are interfaces in the Berkeley DB library which either directly output informational messages or statistical information, or configure the library to output such messages when performing other operations, for example, DbEnv::set_verbose and DbEnv::stat_print.

The DbEnv::set_msgfile and Db::set_msgfile methods are used to display these messages for the application. In this case, the message will include a trailing <newline> character.

Setting msgfile to NULL unconfigures the interface.

Alternatively, you can use the DbEnv::set_message_stream and Db::set_message_stream methods to display the messages via an output stream, or the DbEnv::set_msgcall and Db::set_msgcall methods to capture the additional error information in a way that does not use either output streams or C library FILE *'s. You should not mix these approaches.

For Db handles opened inside of Berkeley DB environments, calling the Db::set_msgfile method affects the entire environment and is equivalent to calling the DbEnv::set_msgfile method.

The Db::set_msgfile method configures operations performed using the specified Db handle, not all operations performed on the underlying database.

The Db::set_msgfile method may be called at any time during the life of the application.

### Parameters

msgfile
  The msgfile parameter is a C library FILE * to be used for displaying messages.

### Description: Db::get_msgfile

The Db::get_msgfile method returns the FILE *.

The Db::get_msgfile method may be called at any time during the life of the application.

The Db::get_msgfile method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

### Parameters

msgfilep
  The Db::get_msgfile method returns the FILE * in msgfilep.

### Class

Db

### See Also

Databases and Related Methods`

Copyright (c) 1996,2007 Oracle. All rights reserved.