108
Debug output is written to STDERR unless PMEMOBJ_LOG_FILE is set. To set a debug
level, use
$ export PMEMOBJ_LOG_LEVEL=2
$ ./my_app
PMEMOBJ_LOG_FILE
The value of PMEMOBJ_LOG_FILE includes the full path and file name of a file where all
logging information should be written. If PMEMOBJ_LOG_FILE is not set, logging output is
written to STDERR.
The following example defines the location of the log file to /var/tmp/libpmemobj_
debug.log, ensures we are using the debug version of libpmemobj when executing
my_app in the background, sets the debug log level to 2, and monitors the log in real time
using tail -f:
$ export PMEMOBJ_LOG_FILE=/var/tmp/libpmemobj_debug.log
$ export PMEMOBJ_LOG_LEVEL=2
$ LD_PRELOAD=/usr/lib64/pmdk_debug ./my_app &
$ tail –f /var/tmp/libpmemobj_debug.log
If the last character in the debug log file name is "-", the process identifier (PID) of
the current process will be appended to the file name when the log file is created. This is
useful if you are debugging multiple processes.
Summary
This chapter describes the libpmemobj library, which is designed to simplify persistent
memory programming. By providing APIs that deliver atomic operations, transactions,
and reserve/publish features, it makes creating applications less error prone while
delivering guarantees for data integrity.
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
Debug output is written to STDERR unless PMEMOBJ_LOG_FILE is set. To set a debug
level, use
$ export PMEMOBJ_LOG_LEVEL=2
$ ./my_app
PMEMOBJ_LOG_FILE
The value of PMEMOBJ_LOG_FILE includes the full path and file name of a file where all
logging information should be written. If PMEMOBJ_LOG_FILE is not set, logging output is
written to STDERR.
The following example defines the location of the log file to /var/tmp/libpmemobj_
debug.log, ensures we are using the debug version of libpmemobj when executing
my_app in the background, sets the debug log level to 2, and monitors the log in real time
using tail -f:
$ export PMEMOBJ_LOG_FILE=/var/tmp/libpmemobj_debug.log
$ export PMEMOBJ_LOG_LEVEL=2
$ LD_PRELOAD=/usr/lib64/pmdk_debug ./my_app &
$ tail –f /var/tmp/libpmemobj_debug.log
If the last character in the debug log file name is "-", the process identifier (PID) of
the current process will be appended to the file name when the log file is created. This is
useful if you are debugging multiple processes.
Summary
This chapter describes the libpmemobj library, which is designed to simplify persistent
memory programming. By providing APIs that deliver atomic operations, transactions,
and reserve/publish features, it makes creating applications less error prone while
delivering guarantees for data integrity.
Chapter 7 libpmemobj: a Native traNsaCtioNal objeCt store
