\ApacheZen
Just meditative web-log viewer
Synopsis
class ApacheZen
{
- // constants
- const URL_ME = '?module=apachezen';
- const URL_BACK = '?module=report_sysload';
- const URL_CODE = 'https://github.com/nightflyza/Ubilling/';
- const ROUTE_ERRORS = 'errorlog';
- const ROUTE_PHPERR = 'phperrors';
- const ERROR_FILTER = 'on line';
- // members
- protected array $billCfg = ;
- protected string $logPath = '/var/log/httpd-access.log';
- protected string $errorLogPath = '/var/log/httpd-error.log';
- protected string $flowId = 'apzjcb';
- protected integer $linesRead = 500;
- protected integer $linesRender = 40;
- protected integer $timeout = 1000;
- protected string $currentSource = '';
- protected string $grep = '';
- protected string $tail = '';
- protected string $cat = '';
- protected string $renderStyle = 'font-family: monospace;';
- protected bool $errorLogFlag = false;
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void setLogType()
- protected void setDataSource()
- protected bool dataSourceExists()
- public string render()
- public string renderPHPErrors()
- protected string colorize()
- public string getFlowId()
- public int getTimeout()
- public string controls()
- public string getCurrentSource()
Constants
Name | Value |
---|---|
URL_ME | '?module=apachezen' |
URL_BACK | '?module=report_sysload' |
URL_CODE | 'https://github.com/nightflyza/Ubilling/' |
ROUTE_ERRORS | 'errorlog' |
ROUTE_PHPERR | 'phperrors' |
ERROR_FILTER | 'on line' |
Members
protected
- $billCfg
—
array
Contains billing.ini config as key=>value - $cat
—
string
Contains system cat path - $currentSource
—
string
Current zen source - $errorLogFlag
—
bool
Render access log or errorlog flag - $errorLogPath
—
string
Default error log path - $flowId
—
string
Default flow identifier to ignore self requests - $grep
—
string
Contains system grep path - $linesRead
—
int
Count of lines to read from log - $linesRender
—
int
Count of lines to render in viewport - $logPath
—
string
Default datasource file to read - $renderStyle
—
string
Dynamic view-port default style - $tail
—
string
Contains system tail path - $timeout
—
int
Default container refresh timeout in ms.
Methods
protected
- colorize() — Paints some subStr into some color if its appears in text
- dataSourceExists() — Checks is datasource file exists
- loadConfigs() — Preloads required configs for further usage
- setDataSource() — Sets alternative datasource path
- setLogType() — Sets current instance log type
public
- __construct() — owls are not what they seem
- controls() — Just returns default module controls
- getCurrentSource() — Returns current data source
- getFlowId() — Returns current container flowID
- getTimeout() — Returns current instance refresh timeout
- render() — Renders the few last lines from data source.
- renderPHPErrors() — Renders latest PHP errors in scripts