Esempio n. 1
0
                $newlogline .= $loglinearray[4] . " ";
                $newlogline .= $loglinearray[5] . " ";
                $newlogline .= $loglinearray[6] . " ";
                $newlogline .= $loglinearray[7] . " ";
                $newlogline .= $loglinearray[8] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 9] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 10] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 11] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 12] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 13] . " ";
                $newlogline .= $loglinearray[($creatlogloop - 1) * 6 + 14];
                if ($mode == "syslog") {
                    if ($debug == "all") {
                        $selflog = "Ready to write log line to syslog: " . $newlogline . "\n";
                        WriteDebugLog($selflog);
                        $selflog = "";
                    }
                    WriteSyslog(rtrim($newlogline));
                } elseif ($mode == "direct") {
                    if ($debug == "all") {
                        $selflog = "Ready to write log line directly to file: " . $newlogline . "\n";
                        WriteDebugLog($selflog);
                        $selflog = "";
                    }
                    $newlogline = date("M j G:i:s") . " rtr2syslog: " . $newlogline;
                    WriteDirectLog(rtrim($newlogline));
                }
            }
        }
    }
}
Esempio n. 2
0
<?php

if (!@(include 'config.php')) {
    die('Config not found.  Please read README.');
}
require 'functions.php';
if ($mode == "syslog") {
    WriteSyslog("Test log for rtr2syslog using logtest.php");
    WriteDebugLog("Sent test log to syslog via logtest.php.\n");
} elseif ($mode == "direct") {
    WriteDirectLog("Test log for rtr2syslog using logtest.php");
    WriteDebugLog("Sent test log to logfile via logtest.php.\n");
}