Exemple #1
0
function pick_count()
{
    //clear_pick_cache(1);//缓存定期清理
    //clear_search_index(1);//清除索引
    clear_log(1);
    //清除日志
    pload('C:cache');
    $arr['search_index']['name'] = milu_lang('rules_search_index');
    $arr['search_index']['msg'] = milu_lang('search_index_notice');
    $arr['search_index']['show'] = '<span style=" width:120px; float:left">' . milu_lang('search_index_c') . '<hr>';
    $type_arr = array('1' => milu_lang('fast_pick_rules'), '2' => milu_lang('dxc_system_rules'), '3' => milu_lang('fastpick_evo'));
    $type_arr2 = array('3' => milu_lang('server_'), '4' => milu_lang('local_'));
    foreach ($type_arr as $k => $v) {
        foreach ($type_arr2 as $k2 => $v2) {
            $type = $k . $k2;
            $show_name = '<span style=" width:120px; float:left">' . $type_arr[$k] . $type_arr2[$k2] . '</span>';
            $search_index_count = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_searchindex') . " WHERE type='{$type}'"), 0);
            $arr['search_index']['show'] .= $show_name . ' ' . $search_index_count . '<br />';
        }
    }
    $log_info = IO::info(PICK_DIR . '/data/log');
    $arr['log']['name'] = milu_lang('log_size');
    $arr['log']['msg'] = milu_lang('auto_pick_notice');
    $arr['log']['show'] = sizecount($log_info['size']);
    $cache_info = IO::info(PICK_CACHE, 1, 1);
    $arr['cache']['name'] = milu_lang('cache_file_size');
    $arr['cache']['show'] = milu_lang('cache_size_value', array('s' => sizecount($cache_info['size']), 'p' => PICK_CACHE_SIZE));
    $arr['cache']['msg'] = milu_lang('cache_notice');
    return $arr;
}
function clear_all_log_files()
{
    killbyname('syslogd');
    $clog_files = array('dhcpd', 'filter', 'gateways', 'ipsec', 'l2tps', 'lighttpd', 'ntpd', 'openvpn', 'poes', 'portalauth', 'ppps', 'pptps', 'relayd', 'resolver', 'routing', 'system', 'vpn', 'wireless');
    $log_files = array('squid/access', 'squid/cache', 'squid/store');
    foreach ($clog_files as $lfile) {
        clear_clog("/var/log/{$lfile}.log", false);
    }
    foreach ($log_files as $lfile) {
        clear_log("/var/log/{$lfile}.log", false);
    }
    system_syslogd_start();
    killbyname('dhcpd');
    services_dhcpd_configure();
}
        //while
    }
}
function clear_log()
{
    global $sql;
    if (isset($_POST['uaction']) && $_POST['uaction'] === 'clear_log') {
        $query = <<<SQL_QUERY
            delete
                from
            log
SQL_QUERY;
        $rs = exec_query($sql, $query, array());
    }
}
/*
 *
 * static page messages.
 *
 */
gen_admin_menu($tpl);
clear_log();
generate_page($tpl);
$tpl->assign(array('TR_ADMIN_LOG' => tr('Admin Log'), 'TR_CLEAR_LOG' => tr('Clear log'), 'TR_DATE' => tr('Date'), 'TR_MESSAGE' => tr('Message')));
//gen_page_message($tpl);
$tpl->parse('PAGE', 'page');
$tpl->prnt();
if (isset($cfg['DUMP_GUI_DEBUG'])) {
    dump_gui_debug();
}
unset_messages();
Exemple #4
0
	POSSIBILITY OF SUCH DAMAGE.
*/
require_once "guiconfig.inc";
require_once "system.inc";
if (empty($config['syslog']['nentries'])) {
    $nentries = 50;
} else {
    $nentries = $config['syslog']['nentries'];
}
$type = 'cache';
if (isset($_GET['type']) && $_GET['type'] === 'access') {
    $type = $_GET['type'];
}
$logfile = "/var/log/squid/{$type}.log";
if (isset($_GET['clear'])) {
    clear_log($logfile);
}
$pgtitle = array(gettext("Status"), gettext("System logs"), gettext("Proxy"));
include "head.inc";
?>

<body>
<?php 
include "fbegin.inc";
?>
<section class="page-content-main">
    <div class="container-fluid">
        <div class="row">
            <section class="col-xs-12">
                <?php 
include 'diag_logs_tabs.inc';
Exemple #5
0
function print_log($log)
{
    echo '<pre>' . print_r($log, true) . '</pre>';
    clear_log();
}