Version 2.02.161 -
================================
+ New LVM_LOG_FILE_MAX_LINES env var to limit max size of created logs.
Version 2.02.160 - 6th July 2016
================================
static int _syslog = 0;
static int _log_to_file = 0;
+static uint64_t _log_file_max_lines = 0;
+static uint64_t _log_file_lines = 0;
static int _log_direct = 0;
static int _log_while_suspended = 0;
static int _indent = 1;
if (st && fclose(st))
log_sys_debug("fclose", statfile);
+
+ if ((env = getenv("LVM_LOG_FILE_MAX_LINES"))) {
+ if (sscanf(env, FMTu64, &_log_file_max_lines) != 1) {
+ log_warn("WARNING: Ingnoring incorrect LVM_LOG_MAX_LINES envvar \"%s\".", env);
+ _log_file_max_lines = 0;
+ }
+ _log_file_lines = 0;
+ }
}
no_epoch:
fputc('\n', _log_file);
fflush(_log_file);
+
+ if (_log_file_max_lines && ++_log_file_lines >= _log_file_max_lines)
+ fatal_internal_error = 1;
}
if (_syslog && (_log_while_suspended || !critical_section())) {
this format string "_%s_%d_%llu". When set, each process logs to a
separate file.
.TP
+.B LVM_LOG_FILE_MAX_LINES
+A max number of lines to be printed to log file before
+the application aborts. Useful for testing to prevent creation
+of too big log files from spinning command.
+.TP
.B LVM_EXPECTED_EXIT_STATUS
The status anticipated when the process exits. Use ">N" to match any
status greater than N. If the actual exit status matches and a log
export TESTOLDPWD TESTDIR COMMON_PREFIX PREFIX RUNNING_DMEVENTD
export LVM_LOG_FILE_EPOCH=DEBUG
+export LVM_LOG_FILE_MAX_LINES=100000
export LVM_EXPECTED_EXIT_STATUS=1
test -n "$BASH" && trap 'set +vx; STACKTRACE; set -vx' ERR