File: show_log.php

package info (click to toggle)
boinc 5.4.11-4%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 21,440 kB
  • ctags: 16,986
  • sloc: cpp: 70,682; ansic: 45,747; php: 35,513; xml: 10,487; sh: 9,324; python: 4,291; makefile: 1,958; asm: 1,258; perl: 914; sql: 395; csh: 126; pascal: 124
file content (42 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
$cvs_version_tracker[]="\$Id: show_log.php,v 1.15 2005/02/08 04:38:31 ballen Exp $";  //Generated automatically - do not edit
// grep logs for a particular string

require_once("../inc/util_ops.inc");

$log_dir = parse_config(get_config(), "<log_dir>");
if (!$log_dir) {
    exit("Error: couldn't get log_dir from config file.");
}

$f = $_GET["f"];
$s = $_GET["s"];
$l = (int)$_GET["l"];

//if (!$f || !preg_match("/^ *([a-z_*]+[.](log|out) *)+$/", $f)) {
//    $f = 'log_*/*.log';
//}

if ($s) {
    admin_page_head("Grep logs for \"$s\"");
} else {
    admin_page_head("Show logs");
}

echo "<form action=\"show_log.php\">";
echo " Regexp: <input name=\"s\" value=\"$s\">";
echo " Files: <input name=\"f\" value=\"$f\">";
echo " Lines: <input name=\"l\" value=\"$l\"> (positive for head, negative for tail)";
echo " <input type=\"submit\" value=\"Grep\"></form>";

echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>';

if (strlen($f))
	$f = "../log*/". $f;
else
    $f = "../log*/*.log";
    
passthru("cd $log_dir && ../bin/grep_logs -html -l $l '$s' $f 2>&1 $lines");

admin_page_tail();
?>