Library Version 11.2.5.3

Db::set_message_stream()
Prev | Chapter 2. The Db Handle | Next

## Db::set_message_stream()

    #include <db_cxx.h>

    void Db::set_message_stream(class ostream*);

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, the DbEnv::set_verbose() and DbEnv::stat_print() methods.

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

Setting stream to NULL unconfigures the interface.

Alternatively, you can use the DbEnv::set_msgfile() or Db::set_msgfile() methods to display the additional information via a C Library `FILE *`, 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_message_stream()` method affects the entire environment and is equivalent to calling the DbEnv::set_message_stream() method.

The `Db::set_message_stream()` method configures operations performed using the specified Db handle, not all operations performed on the underlying database.

The `Db::set_message_stream()` method may be called at any time during the life of the application.

### Parameters

#### stream

The stream parameter is the application-specified output stream to be used for additional message information.

### Class

Db

### See Also

Database and Related Methods

Prev | Up | Next
Db::set_lorder() | Home | Db::set_msgcall()