ctdb-common: Use Samba's DEBUG_FILE logging
commit10d15c9e5dfe4e8595d0b322c96f474fc7078f46
authorMartin Schwenke <martin@meltin.net>
Thu, 23 Sep 2021 08:37:57 +0000 (23 18:37 +1000)
committerAmitay Isaacs <amitay@samba.org>
Mon, 17 Jan 2022 03:43:30 +0000 (17 03:43 +0000)
treea2ae8fb78aa923562ce599a465c189f562a3d6a7
parent666a048707436a8ba3b9a9cb297a4fd504fa1e54
ctdb-common: Use Samba's DEBUG_FILE logging

This has support for log rotation (or re-opening).

The log format is updated to use an RFC5424 timestamp and to include a
hostname.  The addition of the hostname allows trivial merging of log
files from multiple cluster nodes.

The hostname is faked from the CTDB_BASE environment variable during
testing, as per the comment in the code.  It is currently faked in a
similar manner in local_daemons.sh when printing logs, so drop this.

Unit tests need updating because stderr logging no longer produces a
"PROGNAME[PID]: " header.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/logging.c
ctdb/tests/UNIT/cunit/sock_daemon_test_001.sh
ctdb/tests/UNIT/eventd/eventd_051.sh
ctdb/tests/UNIT/eventd/scripts/local.sh
ctdb/tests/local_daemons.sh