[PATCHES] CTDB logging rework

Martin Schwenke martin at meltin.net
Thu Oct 16 21:53:01 MDT 2014

This reworks much of the CTDB logging subsystem.  Main points are:

* Bug fix to put a newline back at the end of messages logged to file
  (recent regression).

* Remove the separate CTDB log daemon.

* Add syslog via UDP logging, as per RFCs 5424 and RFC5426.

  This provides the same functionality as the current CTDB log daemon
  but outsources the implementation to the syslog daemon.  :-)

* Modular backends.

* Remove debug levels DEBUG_EMERG, DEBUG_ALERT and DEBUG_CRIT.

  CTDB has too many debug levels and the above are incompatible with
  Samba's debug code. This keeps DEBUG_ALERT and DEBUG_CRIT as
  internally defined to DEBUG_ERR to avoid code churn.  DEBUG_EMERG is
  already unused.

* Single CTDB_LOGGING option (corresponding to --logging daemon
  option).  Valid values are:


  Default remains file:...

Please review and push if OK.

These patches are in my ctdb-logging branch:


Still to do:

* Handle debug_extra at backend initialisation time.

* Use debug.[ch] file and syslog backends directly instead of using
  callbacks for everything.

* Move the syslog UDP backend into debug.[ch] as an option.

  The only real nit here is that this code needs a hostname.  The above
  code uses the samba-util get_myname() function, which does charset
  things... so this probably isn't desirable to pull into debug.[ch].
  The hostname could be passed into the backend initialisation,
  probably via setup_logging(). I'm interested in alternatives...  :-)

peace & happiness,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba.patches
Type: application/octet-stream
Size: 92361 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20141017/c07b35b6/attachment.obj>

More information about the samba-technical mailing list