[syslog-ng]one thing could better (i think so)

Balazs Scheidler bazsi@balabit.hu
Fri, 21 Dec 2001 17:52:53 +0100


On Fri, Dec 21, 2001 at 03:01:09PM +0100, Lukasz Wojtow wrote:
> Hi!
> Syslog-n is great, but I have one suggestion what could be
> better: when new configuration starts and there is an error in
> config file, syslog writes to log message like: "Syntax error
> reading config file, using old configuration". Yea... but where is
> this error? I have configured syslog-ng with few hundreds lines
> and i haved an error somewhere :/ Couldn't syslog write a line
> number where an error occured?
> Best regards,
> Lukasz Wojtow
> 
> ps. an error was "filteer" instead "filter" :)

try this patch (against 1.5.x, but should apply to 1.4.x as well):

diff -u -r1.37 main.c
--- main.c	2001/12/14 12:52:50	1.37
+++ main.c	2001/12/21 16:52:13
@@ -46,6 +46,7 @@
 
 static char cfgfilename[128] = PATH_SYSLOG_NG_CONF;
 static char pidfilename[128] = PATH_PIDFILE;
+extern int linenum;
 
 /* CLASS:
    (class
@@ -196,7 +197,7 @@
 			}
 			else {
 				backend->super.reloading = 0;
-				notice("Syntax error reading config file, using old configuration\n");
+				notice("Syntax error reading config file (line %i), using old configuration\n", linenum);
 			}
 			reload_config = 0;
 		}
@@ -421,7 +422,7 @@
 	
 	backend->configuration = make_syslog_config(cfgfilename, &backend->super);
 	if (!backend->configuration) {
-		werror("Parse error reading configuration file, exiting.\n");
+		werror("Parse error reading configuration file, exiting. (line %i)\n", linenum);
 		return 1;
 	}
 	if (syntax_only) {


-- 
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1