<?php
include_once(_DIR_TO_CLASS.'/c_page.php') ;
class c_page_cab_log extends c_page
{
  public $h1='Журналы' ;

 function second_menu_config()
  { $this->second_menu=array('/cab/log/req/'=>'Журнал обмена',
                             '/cab/log/events/'=>array('title'=>'Журнал событий'),
		                     '/cab/log/pages/'=>array('title'=>'Журнал страниц'),
                             '/cab/log/sql_long/'=>array('title'=>'Долгие SQL'),
                             '/cab/log/sql_long_stats/'=>array('title'=>'Долгие SQL (статистика)'),
                             '/cab/log/sql_errors/'=>array('title'=>'Ошибки SQL'),
                             '/cab/log/disk/'=>array('title'=>'Загрузка диска'),
                             '/cab/log/cluster/'=>array('title'=>'Кластер БД'),
                             '/cab/debug/info/'=>'Информация',
                           );
 }

  function block_main()
  { if (isset($this->filter['fname']) and is_file(_DIR_TO_ROOT.'/logs/'.$this->filter['fname']))
    { $this->h1=$this->filter['fname'] ;
      $this->page_title() ;
	    if (strpos($this->filter['fname'],'json')!==false) LOG_JSON()->view(_DIR_TO_ROOT.'/logs/'.$this->filter['fname']) ;
      else  echo file_get_contents(_DIR_TO_ROOT.'/logs/'.$this->filter['fname']) ;
    }
    else
    { $this->page_title() ;
      echo 'Файл не найден' ;
    }
  }

}

?>
