--- /usr/share/cacti/site/lib/functions.php~	2005-05-15 17:04:07.000000000 +0100
+++ /usr/share/cacti/site/lib/functions.php	2005-05-25 19:08:41.000000000 +0100
@@ -305,7 +305,7 @@
 
 /* cacti_log - logs a string to Cacti's log file or optionally to the browser
    @arg $string - the string to append to the log file
-   @arg $output - (bool) whether to output the log line to the browser using pring() or not */
+   @arg $output - if set to "stderr" output is also written to stderr, if any other non-false value it's written to stdout */
 function cacti_log($string, $output = false, $environ = "CMDPHP") {
 	global $config;
 
@@ -376,7 +376,9 @@
    }
 
 	/* print output to standard out if required */
-	if ($output == true) {
+	if ($output == "stderr") {
+		fwrite(STDERR, $message . "\n");
+	} else if ($output) {
 		print $message;
 	}
 }
--- /usr/share/cacti/site/poller.php~	2004-12-19 20:01:49.000000000 +0000
+++ /usr/share/cacti/site/poller.php	2005-05-25 19:02:36.000000000 +0100
@@ -180,7 +180,7 @@
 			/* end the process if the runtime exceeds MAX_POLLER_RUNTIME */
 			if (($start + MAX_POLLER_RUNTIME) < time()) {
 				rrd_close($rrdtool_pipe);
-				cacti_log("Maximum runtime of " . MAX_POLLER_RUNTIME . " seconds exceeded. Exiting.", true, "POLLER");
+				cacti_log("Maximum runtime of " . MAX_POLLER_RUNTIME . " seconds exceeded. Exiting.", "stderr", "POLLER");
 				exit;
 			}
 
