⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loggerclasstest.php

📁 Professional PHP5 code for this book
💻 PHP
字号:
<?phprequire_once('class.Logger.php');$cfg['LOGGER_FILE'] = '/var/log/myapplication.log';$cfg['LOGGER_LEVEL'] = LOGGER_INFO;$log = Logger::getInstance();if(isset($_GET['fooid'])) {    //not written to the log - the log level is too high  $log->logMessage('A fooid is present', LOGGER_DEBUG);    //LOG_INFO is the default so this would get printed  $log->logMessage('The value of fooid is ' .  $_GET['fooid']);  } else {    //This will also be written, and includes a module name  $log->logMessage('No fooid passed from ' . $_SERVER['HTTP_REFERER'],                    LOGGER_CRITICAL,                   "Foo Module");    throw new Exception('No foo id!');}?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -