DB_ENV->log_printf()
Prev | Chapter 7. The DB_LSN Handle | Next

## DB_ENV->log_printf()

    #include <db.h>

    int
    DB_ENV->log_printf(DB_ENV *env, DB_TXN *txnid, const char *fmt, ...);

The `DB_ENV->log_printf()` method appends an informational message to the Berkeley DB database environment log files.

The `DB_ENV->log_printf()` method allows applications to include information in the database environment log files, for later review using the db_printlog utility. This method is intended for debugging and performance tuning.

The `DB_ENV->log_printf()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### txnid

If the logged message refers to an application-specified transaction, the txnid parameter is a transaction handle returned from DB_ENV->txn_begin(); otherwise NULL.

#### fmt

A format string that specifies how subsequent arguments (or arguments accessed via the variable-length argument facilities of stdarg(3)) are converted for output. The format string may contain any formatting directives supported by the underlying C library vsnprintf(3) function.

### Errors

The `DB_ENV->log_printf()` method may fail and return one of the following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DB_ENV, DB_LOGC, DB_LSN

### See Also

Logging Subsystem and Related Methods

Prev | Up | Next
DB_ENV->log_get_config() | Home | DB_ENV->log_put()