summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--doc/ulogd.sgml37
-rw-r--r--extensions/ulogd_LOGEMU.c27
3 files changed, 48 insertions, 17 deletions
diff --git a/Changes b/Changes
index 41bb41d..a5d72fb 100644
--- a/Changes
+++ b/Changes
@@ -5,6 +5,7 @@ Version 0.96
- autoconf now includes /usr/src/linux/include, because most distros
now have a glibc-provided /usr/include/linux :(
- removed ./configure from CVS tree as it may cause inconsistencies
+- added support for synchronous write to LOGEMU (Michael Stolovitzsky)
Version 0.95
- libipulog problems of 0.94 fixed
diff --git a/doc/ulogd.sgml b/doc/ulogd.sgml
index 7202f45..750249c 100644
--- a/doc/ulogd.sgml
+++ b/doc/ulogd.sgml
@@ -1,12 +1,12 @@
<!doctype linuxdoc system>
-<!-- $Id: ulogd.sgml,v 1.3 2001/01/29 11:45:22 laforge Exp $ -->
+<!-- $Id: ulogd.sgml,v 1.4 2001/05/20 13:50:05 laforge Exp $ -->
<article>
<title>ULOGD - the Userspace Logging Daemon</title>
<author>Harald Welte &lt;laforge@gnumonks.org&gt</author>
-<date>Revision $Revision: 1.3 $, $Date: 2001/01/29 11:45:22 $</date>
+<date>Revision $Revision: 1.4 $, $Date: 2001/05/20 13:50:05 $</date>
<abstract>
This is the documentation for <tt>ulogd</tt>, the Userspace logging daemon.
@@ -178,16 +178,29 @@ The module defines the following configuration directives:
<descrip>
<tag>syslogfile</tag>The filename where it should log to. The default is <tt>/var/log/ulogd.syslogemu</tt>
</descrip>
+<descrip>
+<tag>syslogsync</tag>Set this to 1 if you want to have your logfile written synchronously. This may reduce performance, but makes your log-lines appear immediately. The default is <tt>0</tt>
+</descrip>
<tag>ulogd_MYSQL.so</tag>
-An output plugin for logging into a mysql database. This is only compiled if you have the mysql libraries installed, and the configure script was able to detect them. (FIXME: how to do this)
-<p>
-The plugin automagically inserts the data into the configured table; It connects to mysql during the startup phase of ulogd and obtains a list of the columns in the table. Then it tries to resolve the column names against keys of interpreter plugins. This way you can easly select which information you want to log - just by the layout of the table.
-<p>
-If, for example, your table contains a field called 'ip_saddr', ulogd will resolve this against the key 'ip.saddr' and put the ip address as 32bit unsigned integer into the table.
-<p>
-You may want to have a look at the file '<tt>doc/mysql.table</tt>' as an example table including fields to log all keys from ulogd_BASE.so. Just delete the fields you are not interested in, and create the table.
-<p>
+An output plugin for logging into a mysql database. This is only compiled if
+you have the mysql libraries installed, and the configure script was able to
+detect them. (that is: --with-mysql was specified for ./configure) <p>
+
+The plugin automagically inserts the data into the configured table; It
+connects to mysql during the startup phase of ulogd and obtains a list of the
+columns in the table. Then it tries to resolve the column names against keys of
+interpreter plugins. This way you can easly select which information you want
+to log - just by the layout of the table. <p>
+
+If, for example, your table contains a field called 'ip_saddr', ulogd will
+resolve this against the key 'ip.saddr' and put the ip address as 32bit
+unsigned integer into the table. <p>
+
+You may want to have a look at the file '<tt>doc/mysql.table</tt>' as an
+example table including fields to log all keys from ulogd_BASE.so. Just delete
+the fields you are not interested in, and create the table. <p>
+
The module defines the following configuration directives:
<descrip>
<tag>mysqltable</tag>
@@ -208,5 +221,9 @@ Password for mysql
All comments / questions / ... are appreciated.
<p>
Just drop me a note to laforge@gnumonks.org
+<p>
+Please note also that there is now a mailinglist, ulogd@lists.gnumonks.org.
+You can subscribe at
+<URL URL="http://lists.gnumonks.org/mailman/listinfo/ulogd/">
</article>
diff --git a/extensions/ulogd_LOGEMU.c b/extensions/ulogd_LOGEMU.c
index c9b1ac5..960084e 100644
--- a/extensions/ulogd_LOGEMU.c
+++ b/extensions/ulogd_LOGEMU.c
@@ -1,4 +1,4 @@
-/* ulogd_LOGEMU.c, Version $Revision: 1.3 $
+/* ulogd_LOGEMU.c, Version $Revision: 1.4 $
*
* ulogd output target for syslog logging emulation
*
@@ -8,7 +8,7 @@
* (C) 2000 by Harald Welte <laforge@gnumonks.org>
* This software is released under the terms of GNU GPL
*
- * $Id: ulogd_LOGEMU.c,v 1.3 2001/02/04 13:39:31 laforge Exp $
+ * $Id: ulogd_LOGEMU.c,v 1.4 2001/03/25 18:25:01 laforge Exp $
*
*/
@@ -27,12 +27,25 @@
#define ULOGD_LOGEMU_DEFAULT "/var/log/ulogd.syslogemu"
#endif
+#ifndef ULOGD_LOGEMU_SYNC_DEFAULT
+#define ULOGD_LOGEMU_SYNC_DEFAULT 0
+#endif
+
#define NIPQUAD(addr) \
((unsigned char *)&addr)[0], \
((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[3]
+static config_entry_t syslogf_ce = { NULL, "syslogfile", CONFIG_TYPE_STRING,
+ CONFIG_OPT_NONE, 0,
+ { string: ULOGD_LOGEMU_DEFAULT } };
+
+static config_entry_t syslsync_ce = { &syslogf_ce, "syslogsync",
+ CONFIG_TYPE_INT, CONFIG_OPT_NONE, 0,
+ { value: ULOGD_LOGEMU_SYNC_DEFAULT }
+ };
+
static FILE *of = NULL;
static char hostname[255];
@@ -206,6 +219,10 @@ int _output_logemu(ulog_iret_t *res)
break;
}
fprintf(of,"\n");
+
+ if (syslsync_ce.u.value)
+ fflush(of);
+
return 0;
}
@@ -243,14 +260,10 @@ static void _logemu_reg_op(void)
register_output(p);
}
-static config_entry_t syslogf_ce = { NULL, "syslogfile", CONFIG_TYPE_STRING,
- CONFIG_OPT_NONE, 0,
- { string: ULOGD_LOGEMU_DEFAULT } };
-
void _init(void)
{
/* FIXME: error handling */
- config_register_key(&syslogf_ce);
+ config_register_key(&syslsync_ce);
config_parse_file(0);
if (gethostname(hostname, sizeof(hostname)) < 0) {