Index: ossp-pkg/fsl/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/fsl/ChangeLog,v rcsdiff -q -kk '-r1.17' '-r1.18' -u '/v/ossp/cvs/ossp-pkg/fsl/ChangeLog,v' 2>/dev/null --- ChangeLog 2003/05/22 12:30:35 1.17 +++ ChangeLog 2003/05/22 14:01:55 1.18 @@ -3,7 +3,7 @@ _|_||_| | | | \___ \___ \| |_) | | |_/ __| | |_||_|_| | |_| |___) |__) | __/ | _\__ \ | |_|_|_| \___/|____/____/|_| |_| |___/_| - + OSSP fsl - Faking/Flexible Syslog Library CHANGELOG @@ -14,28 +14,28 @@ openlog(2) is called without LOG_NDELAY no filedescriptor is consumed. Prevously debugging unconditionally took one or more filedescriptors which violates POSIX. - + *) for compatiblity reasons, the library will no longer print any messages to stderr under any circumstances. If debugging is not possible or disabled, messages will be silently discarded. - + *) for security reasons the process environment is completely ignored. The drawback is that FSL_CFGDIR, FSL_PREFIX and most debugging options are now configure options only. - + *) for safety reasons, when debugging is not used the whole debugging code is replaced with a simple no-operation stub function. - + *) for convenience reasons, what(1) or a "strings binarywithfsl | grep '@(#)'" will provide information about debugging code being omitted or included and, in the latter case, which logfile and logmask are being used. - + *) for convenience reasons and to keep simple things simple, debugging now logs to a file only and support to use l2spec for debugging is entirely removed at this time. The logfile, the logstop maximum file size and the logmask are configure options. - + *) for flexibility reasons but still to stay away from the process environment the logmask is configured by reading the content of a symlink. @@ -111,7 +111,7 @@ Changes between 1.0.0 and 1.0.1 (01-Aug-2002 to 02-Aug-2002) - *) Change building of fsl_version.c from direct inclusion + *) Change building of fsl_version.c from direct inclusion to standard object linking. [Ralf S. Engelschall ] Index: ossp-pkg/fsl/Makefile.in RCS File: /v/ossp/cvs/ossp-pkg/fsl/Makefile.in,v rcsdiff -q -kk '-r1.15' '-r1.16' -u '/v/ossp/cvs/ossp-pkg/fsl/Makefile.in,v' 2>/dev/null --- Makefile.in 2003/05/22 12:30:35 1.15 +++ Makefile.in 2003/05/22 14:01:55 1.16 @@ -84,7 +84,7 @@ _SUBDIRS_distclean _SUBDIRS_realclean _SUBDIRS_depend: @$(MAKE) $(MFLAGS) \ _SUBDIRS_TARGET=`echo $@ | sed -e 's/^_SUBDIRS_//'` \ - _SUBDIRS_STEPDOWN + _SUBDIRS_STEPDOWN # the work horse rule which steps down to the subdirs in a loop _SUBDIRS_STEPDOWN: @@ -164,7 +164,7 @@ -$(RM) Makefile config.h sa-config -$(RM) libtool -realclean: +realclean: @$(MAKE) $(MFLAGS) _SUBDIRS_realclean @$(MAKE) $(MFLAGS) distclean -$(RM) fsl.3 Index: ossp-pkg/fsl/configure.ac RCS File: /v/ossp/cvs/ossp-pkg/fsl/configure.ac,v rcsdiff -q -kk '-r1.14' '-r1.15' -u '/v/ossp/cvs/ossp-pkg/fsl/configure.ac,v' 2>/dev/null --- configure.ac 2003/01/06 16:41:21 1.14 +++ configure.ac 2003/05/22 14:01:55 1.15 @@ -55,16 +55,16 @@ AC_CHECK_LIB(nsl, gethostname) if test ".`echo $LIBS | grep nsl`" = . ;then AC_CHECK_LIB(nsl, gethostbyname) -fi +fi AC_CHECK_LIB(socket, accept) dnl # pre-processing for subdirs LIB_DEPS="" dnl # check for OSSP l2 library -AC_CHECK_EXTLIB([OSSP l2], - l2, l2_stream_log, l2.h, - [SUBDIR_L2=""], +AC_CHECK_EXTLIB([OSSP l2], + l2, l2_stream_log, l2.h, + [SUBDIR_L2=""], [SUBDIR_L2="lib_l2" CPPFLAGS="$CPPFLAGS -Ilib_l2" CFLAGS="$CFLAGS -Ilib_l2" @@ -72,9 +72,9 @@ AC_SUBST(SUBDIR_L2) dnl # check for OSSP cfg library -AC_CHECK_EXTLIB([OSSP cfg], - cfg, cfg_syn_import, cfg.h, - [SUBDIR_CFG=""], +AC_CHECK_EXTLIB([OSSP cfg], + cfg, cfg_syn_import, cfg.h, + [SUBDIR_CFG=""], [SUBDIR_CFG="lib_cfg" CPPFLAGS="$CPPFLAGS -Ilib_cfg" CFLAGS="$CFLAGS -Ilib_cfg" @@ -82,9 +82,9 @@ AC_SUBST(SUBDIR_CFG) dnl # check for OSSP pcre library -AC_CHECK_EXTLIB([OSSP pcre], - pcre, pcre_compile, pcre.h, - [SUBDIR_PCRE=""], +AC_CHECK_EXTLIB([OSSP pcre], + pcre, pcre_compile, pcre.h, + [SUBDIR_PCRE=""], [SUBDIR_PCRE="lib_pcre" CPPFLAGS="$CPPFLAGS -Ilib_pcre" CFLAGS="$CFLAGS -Ilib_pcre" Index: ossp-pkg/fsl/devtool RCS File: /v/ossp/cvs/ossp-pkg/fsl/devtool,v rcsdiff -q -kk '-r1.1' '-r1.2' -u '/v/ossp/cvs/ossp-pkg/fsl/devtool,v' 2>/dev/null --- devtool 2002/07/09 09:42:09 1.1 +++ devtool 2003/05/22 14:01:55 1.2 @@ -1,7 +1,7 @@ #!/bin/sh ## ## devtool -- Development Tool -## Copyright (c) 2001 Ralf S. Engelschall +## Copyright (c) 2001 Ralf S. Engelschall ## if [ $# -eq 0 ]; then Index: ossp-pkg/fsl/devtool.func RCS File: /v/ossp/cvs/ossp-pkg/fsl/devtool.func,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/fsl/devtool.func,v' 2>/dev/null --- devtool.func 2003/01/27 16:29:31 1.2 +++ devtool.func 2003/05/22 14:01:55 1.3 @@ -1,6 +1,6 @@ ## ## devtool.func -- Development Tool Functions -## Copyright (c) 2001-2002 Ralf S. Engelschall +## Copyright (c) 2001-2002 Ralf S. Engelschall ## devtool_require () { Index: ossp-pkg/fsl/fsl.c RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.c,v rcsdiff -q -kk '-r1.60' '-r1.61' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.c,v' 2>/dev/null --- fsl.c 2003/05/22 13:48:45 1.60 +++ fsl.c 2003/05/22 14:01:55 1.61 @@ -200,7 +200,7 @@ int fsldebug_permanentproblem; #endif /* ifdef FSL_DEBUGLOGCODE */ char *fsl_config; -} ctx = { +} ctx = { NULL, NULL, NULL, @@ -217,12 +217,12 @@ #endif /* ifdef FSL_DEBUGLOGCODE */ "@(#)OSSP fsl config " "cfgdir=" FSL_CFGDIR " " - "prefix=" FSL_PREFIX + "prefix=" FSL_PREFIX "\n" "@(#)OSSP fsl debug " #ifdef FSL_DEBUGLOGCODE "logfile=" FSL_DEBUGLOGFILE " " - "logmask=" FSL_DEBUGLOGMASK + "logmask=" FSL_DEBUGLOGMASK #else /* ifdef FSL_DEBUGLOGCODE */ "code omitted" #endif /* ifdef FSL_DEBUGLOGCODE */ @@ -279,7 +279,7 @@ /* level */ l2_util_sprintf( &cpo[cpn], MAXWRITESIZE-cpn, "<%s> ", l2_util_l2s(cp, sizeof(cp), '\0', level) == L2_OK ? cp : "unknown"); cpn = strlen(cpo); - + /* program "name" and pid */ l2_util_sprintf( &cpo[cpn], MAXWRITESIZE-cpn, "%s[%lu^%lu] ", ctx.cpISF != NULL ? ctx.cpISF : "unknown", (unsigned long)getpid(), (unsigned long)getppid()); cpn = strlen(cpo); @@ -504,7 +504,7 @@ return n; } -/* process OSSP cfg node tree directives +/* process OSSP cfg node tree directives mode=0 processes map/ident, mode=1 processes default */ @@ -685,7 +685,7 @@ } if (mapto == -1) { fsldebug(L2_LEVEL_ERROR, "processcfg: trying to map to unknown l2 level \"%s\"", cfgargtoka[2]); CU(FSL_ERR_CUS); } - + ctx.levelmap[mapfrom].l2 = l2level2string[mapto].level; fsldebug(L2_LEVEL_DEBUG, "processcfg: map levelmap[%10s/%d].l2 = l2level2string[%10s/%d].level = 0x%.8lx", cfgargtoka[1], mapfrom, cfgargtoka[2], mapto, (unsigned long)l2level2string[mapto].level); } @@ -767,7 +767,7 @@ for (i = 0; sysloglevel2string[i].string != NULL; i++) { ctx.levelmap[i].syslog = sysloglevel2string[i].level; ctx.levelmap[i].l2 = sysloglevel2string[i].deflevelmap; - fsldebug(L2_LEVEL_DEBUG, "openlog: ctx.levelmap[%d].syslog = 0x%.8lx, ctx.levelmap[%d].l2 = 0x%.8lx", + fsldebug(L2_LEVEL_DEBUG, "openlog: ctx.levelmap[%d].syslog = 0x%.8lx, ctx.levelmap[%d].l2 = 0x%.8lx", i, (unsigned long)ctx.levelmap[i].syslog, i, (unsigned long)ctx.levelmap[i].l2); } @@ -918,7 +918,7 @@ int i; l2_result_t l2rv; char *cp; - + /* tracing */ fsldebug(L2_LEVEL_TRACE, "fsl in vsyslog(3) fmt=%s%s%s ...", fmt == NULL ? "" : "\"", fmt == NULL ? "NULL" : fmt, fmt == NULL ? "" : "\""); Index: ossp-pkg/fsl/fsl.pod RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl.pod,v rcsdiff -q -kk '-r1.28' '-r1.29' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl.pod,v' 2>/dev/null --- fsl.pod 2003/05/22 12:30:35 1.28 +++ fsl.pod 2003/05/22 14:01:55 1.29 @@ -106,7 +106,7 @@ context-free grammar: B ::= B - + B ::= I | B | B '->' B @@ -146,7 +146,7 @@ | 'null' | 'pipe' | 'prefix' - | 'smtp' + | 'smtp' | 'socket' | 'syslog' | ... @@ -157,7 +157,7 @@ B ::= B | B ',' B - + B ::= B '=' B B ::= m/[a-zA-Z][a-zA-Z0-9_-]*/ @@ -203,7 +203,7 @@ messages poured in from upper channels to this file. If the file at the given path already exists, additional data is either appended (I=1) or the existing file is truncated (I=0). The -desired permissions of the file can be set. +desired permissions of the file can be set. o file (STR path m INT append o [0=truncate|1=append] =1 @@ -237,7 +237,7 @@ STR username o [string] =localuser"@"localhost STR realname o [string] =username STR channel o [string] ="#l2" - INT join o [01] =1 use JOIN/PART + INT join o [01] =1 use JOIN/PART STR host m [hostname|address] STR port o [tcpport] =6667 INT timeout o [sec] =30 @@ -375,24 +375,24 @@ -> { (info): filter( regex="foo" - ) + ) -> syslog( remotehost="localhost", ident="l2" ); info: prefix( prefix="[%b %d %H:%M:%S] <%L> [%P]" - ) + ) -> { debug/error: buffer( size=65536 - ) + ) -> file( path="a" ); (trace|debug)/(trace): buffer( size=65536 - ) -> + ) -> file( path="b", perm=0660 @@ -400,17 +400,17 @@ }; prefix() -> { warning: filter( - negate=1, + negate=1, regex="foo" - ) + ) -> irc( host=irc.example.com, timeout=3 ); error: filter( - nocase=1, + nocase=1, regex="foo" - ) + ) -> smtp( host=mail.example.com, rcpt=cfo@example.com @@ -436,45 +436,45 @@ map notice notice; map info info; map debug debug; - + # equivalent of the usual INN syslog.conf(5) entries: # news.crit @l_prefix@/var/inn/log/news.crit # news.err @l_prefix@/var/inn/log/news.err # news.notice @l_prefix@/var/inn/log/news.notice ident (.+)/news q{ prefix( - prefix="%b %d %H:%M:%S %N $1[%P]: ", + prefix="%b %d %H:%M:%S %N $1[%P]: ", timezone=local - ) + ) -> { critical: file( path="@l_prefix@/var/inn/log/news.crit", - append=1, + append=1, perm=0644 ); error: file( path="@l_prefix@/var/inn/log/news.err", - append=1, + append=1, perm=0644 ); notice: file( path="@l_prefix@/var/inn/log/news.notice", - append=1, + append=1, perm=0644 ) } } - + # default logging default (.+)/.+ q{ - debug: + debug: prefix( - prefix="%b %d %H:%M:%S <%L> $1[%P]: ", + prefix="%b %d %H:%M:%S <%L> $1[%P]: ", timezone=local - ) -> + ) -> file( - path="@l_prefix@/var/fsl/default.log", - append=1, + path="@l_prefix@/var/fsl/default.log", + append=1, perm=0644 ) }; @@ -553,7 +553,7 @@ =item F<@FSL_CFGDIR@/@FSL_PREFIX@*> -B reads configuration sections located in these files. +B reads configuration sections located in these files. =back @@ -610,7 +610,7 @@ replacement for its old B library. It was prompted by the necessity to log to multiple files in the B F package and to write messages of particular log levels to different files in -the B F package. +the B F package. The resulting work was generously contributed as Open Source Software to the B project by I Index: ossp-pkg/fsl/fsl_test.cfg RCS File: /v/ossp/cvs/ossp-pkg/fsl/fsl_test.cfg,v rcsdiff -q -kk '-r1.2' '-r1.3' -u '/v/ossp/cvs/ossp-pkg/fsl/fsl_test.cfg,v' 2>/dev/null --- fsl_test.cfg 2002/08/06 11:34:32 1.2 +++ fsl_test.cfg 2003/05/22 14:01:55 1.3 @@ -13,14 +13,14 @@ # default logging specification default (.+)/.+ q{ - debug: + debug: prefix( - prefix="%b %d %H:%M:%S <%L> $1[%P]@%N: ", + prefix="%b %d %H:%M:%S <%L> $1[%P]@%N: ", timezone=local - ) -> + ) -> file( - path="./fsl_test.syslog", - append=1, + path="./fsl_test.syslog", + append=1, perm=0644 ) };