From 040319d8bced2f25bf25d8f6b937901c3a40e34b Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Tue, 30 Apr 2013 17:39:30 +0530 Subject: log: enhance syslog logging using CEE format This patch enables to use syslog as log target in addition to the default. The logs are sent in CEE format (http://cee.mitre.org/). This logging can be disabled using compile time option by ./configure --disable-syslog (or) rpmbuild glusterfs.tar.gz --without syslog The framework provides two api void gf_openlog (const char *ident, int option, int facility); void gf_syslog (int error_code, int facility_priority, char *format, ...); consumers need to call gf_openlog() prior to gf_syslog() like the way traditional syslog function calls. error_code is mandatory when using gf_syslog(). For example, gf_openlog (NULL, -1, -1); gf_syslog (GF_ERR_DEV, LOG_ERR, "error reading configuration file"); Using syslog, admin is free to configure logger to * reduce repeated log messages * forward logs to remote logger * execute a command on certain log pattern * alert people for certain log pattern by email, snmp etc * and many more Change-Id: Ibacbcbbc547192893fc4a46b387496b622e4811f BUG: 928648 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/4915 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 896c2415a..94e087811 100644 --- a/configure.ac +++ b/configure.ac @@ -658,6 +658,20 @@ fi AC_SUBST(CFLAGS) # end enable debug section +# syslog section +AC_ARG_ENABLE([syslog], + AC_HELP_STRING([--disable-syslog], + [Disable syslog for logging])) + +USE_SYSLOG="yes" +if test "x$enable_syslog" != "xno"; then + AC_DEFINE(GF_USE_SYSLOG, 1, [Use syslog for logging]) +else + USE_SYSLOG="no" +fi +AM_CONDITIONAL([ENABLE_SYSLOG], [test x$USE_SYSLOG = xyes]) +#end syslog section + BUILD_READLINE=no AC_CHECK_LIB([readline -lcurses],[readline],[RLLIBS="-lreadline -lcurses"]) AC_CHECK_LIB([readline -ltermcap],[readline],[RLLIBS="-lreadline -ltermcap"]) @@ -768,4 +782,5 @@ echo "Enable Debug : $BUILD_DEBUG" echo "systemtap : $BUILD_SYSTEMTAP" echo "Block Device backend : $BUILD_BD_XLATOR" echo "glupy : $BUILD_GLUPY" +echo "Use syslog : $USE_SYSLOG" echo -- cgit