本文整理汇总了PHP中closelog函数的典型用法代码示例。如果您正苦于以下问题:PHP closelog函数的具体用法?PHP closelog怎么用?PHP closelog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了closelog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: write
/**
* $this->_write( int $level )
* @param int $level - log level
* @return void
* @access public
*/
public function write($level)
{
openlog($this->ident, $this->openlog_opt, $this->facility) or die(ERROR_CANT_OPEN_SYSLOG);
$this->to_string(&$this->last_log);
syslog(self::$id2syslog[$level], $this->last_log) or die(ERROR_CANT_WRITE_SYSLOG);
closelog() or die(ERROR_CANT_CLOSE_SYSLOG);
}
示例2: fp_kill_enumeration
function fp_kill_enumeration()
{
openlog('wordpress(' . $_SERVER['HTTP_HOST'] . ')', LOG_NDELAY | LOG_PID, LOG_AUTH);
syslog(LOG_INFO, "Attempted user enumeration from {$_SERVER['REMOTE_ADDR']}");
closelog();
wp_die('forbidden');
}
示例3: close
public function close()
{
if ($this->_isOpen) {
return closelog();
}
return FALSE;
}
示例4: LogInfo
function LogInfo($msg)
{
global $argv;
openlog($argv[0], LOG_PID, LOG_USER);
syslog(LOG_INFO, $msg);
closelog();
}
示例5: close
/**
* Closes the connection to the system logger, if it is open.
* @access public
*/
function close()
{
if ($this->_opened) {
closelog();
$this->_opened = false;
}
}
示例6: events
function events($text)
{
$LOG_SEV = LOG_INFO;
openlog("coova-chilli", LOG_PID, LOG_SYSLOG);
syslog($LOG_SEV, $text);
closelog();
}
示例7: _log
function _log($text)
{
openlog("wechat", LOG_PID | LOG_PERROR, LOG_LOCAL0);
syslog(LOG_DEBUG, $text);
closelog();
return $text;
}
示例8: processData
function processData()
{
$flag = false;
$firstName = $_POST['firstname'];
if (strlen($firstName) == 0) {
$flag = true;
}
$lastName = $_POST['lastname'];
if (strlen($lastName) == 0) {
$flag = true;
}
$emailAddress = $_POST['emailaddress'];
if (strlen($emailAddress) == 0) {
$flag = true;
}
if ($flag == false) {
openlog('php', LOG_CONS | LOG_NDELAY | LOG_PID, LOG_USER | LOG_PERROR);
syslog(LOG_ERR, 'Error!');
syslog(LOG_INFO, "{$firstName} {$lastName} {$emailAddress}");
closelog();
echo "<style type='text/css'>#formContainer{display:none;}</style>";
echo "\n\t\t\t\t\t\t\t\t\t\t<h3 class='FormLabel'>SUCCESS!</h3>\n\t\t\t\t\t\t\t\t\t\tThank you for creating an account {$firstName} {$lastName}!\n\t\t\t\t\t\t\t\t\t\tA confirmation email has been sent to {$emailAddress}.\n\t\t\t\t\t\t\t\t\t\tOnce you receive this email please follow the instructions\n\t\t\t\t\t\t\t\t\t\tprovided to active your new account.\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t<h6>This page will refresh in 10 seconds...</h6>\n\t\t\t\t\t\t\t\t\t";
header("refresh:10;url=index.php");
}
}
示例9: log
public function log()
{
$argsNum = func_num_args();
if ($argsNum < 2) {
return false;
}
$args = func_get_args();
$priority = $args[0];
$message = $args[1];
if ($priority > $this->allowPriority) {
return false;
}
$priorityName = $this->getLevelName($priority);
$strLog = '';
if ($priorityName) {
$strLog = "[{$priorityName}]";
}
$strLog .= "{$message}";
for ($i = 2; $i < $argsNum; $i++) {
$strLog .= $args[$i];
}
openlog('SPF', LOG_PID, LOG_USER);
syslog($priority, $strLog);
closelog();
}
示例10: writeLog
public function writeLog($message = null, $code = null)
{
if (empty($this->message) && empty($message)) {
return;
} else {
$this->message = $message;
}
if (empty($this->code) && empty($code)) {
$this->code = 0;
} else {
$this->code = $code;
}
if (openlog(LoggingConfig::LOG_IDENT, LOG_PID | LOG_CONS, LoggingConfig::LOG_FACILITY) === true) {
$entries = explode("\n", $this->message);
foreach ($entries as $entry) {
syslog(LOG_INFO, sprintf("(%s) [%s] %s %s %s - %s", $this->ip, $this->user, strtoupper($this->method), $this->code, $this->uri, $entry));
}
if (LoggingConfig::LOG_DEBUG == true && !empty($this->input) && $this->input != "null") {
syslog(LOG_DEBUG, sprintf("(%s) [%s] Input: %s", $this->ip, $this->user, $this->input));
}
if (LoggingConfig::LOG_DEBUG == true && !empty($this->output) && $this->output != "null") {
syslog(LOG_DEBUG, sprintf("(%s) [%s] Output: %s", $this->ip, $this->user, $this->output));
}
closelog();
} else {
trigger_error("Could not open syslog facility", E_USER_ERROR);
}
}
示例11: Debuglogs
function Debuglogs($text = null, $function = null, $line = null)
{
if (!$GLOBALS["DEBUG"]) {
return;
}
if ($text == null) {
return;
}
$linetext = null;
if ($function == null) {
if (function_exists("debug_backtrace")) {
$trace = @debug_backtrace();
}
if (is_array($trace)) {
$filename = basename($trace[1]["file"]);
$function = $trace[1]["function"];
$line = $trace[1]["line"];
}
}
$linetext = $text;
if ($function != null) {
$linetext = "{$function}/{$line} {$linetext}";
} else {
if ($line != null) {
$linetext = "{$line} {$linetext}";
}
}
if (function_exists("syslog")) {
$LOG_SEV = LOG_INFO;
openlog("error_page", LOG_PID, LOG_SYSLOG);
syslog($LOG_SEV, $linetext);
closelog();
}
}
示例12: __destruct
public function __destruct()
{
$this->teardown();
$this->logMessage("BTG destructed");
// Close syslog.
closelog();
}
示例13: logMessage
function logMessage($type, $level, $message)
{
global $debug;
global $use_syslog;
if ($use_syslog) {
define_syslog_variables();
if ($debug) {
}
if ($level == 0) {
$s_level = LOG_ERR;
} else {
if ($level == 1) {
$s_level = LOG_WARNING;
} else {
if ($level == 2) {
$s_level = LOG_INFO;
} else {
if ($level == 3) {
$s_level = LOG_DEBUG;
} else {
$s_level = LOG_ERR;
}
}
}
}
$s_message = $type . " " . $message;
openlog("restbot", LOG_PID, LOG_DAEMON);
syslog($s_level, $s_message);
closelog();
}
}
示例14: init
public static function init($ident, $facility)
{
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
self::$facilities['local0'] = LOG_LOCAL0;
self::$facilities['local1'] = LOG_LOCAL1;
self::$facilities['local2'] = LOG_LOCAL2;
self::$facilities['local3'] = LOG_LOCAL3;
self::$facilities['local4'] = LOG_LOCAL4;
self::$facilities['local5'] = LOG_LOCAL5;
self::$facilities['local6'] = LOG_LOCAL6;
self::$facilities['local7'] = LOG_LOCAL7;
}
if (array_key_exists(strtolower($facility), self::$facilities)) {
$facility = self::$facilities[strtolower($facility)];
} elseif (!in_array($facility, array_values(self::$facilities), true)) {
throw new \UnexpectedValueException('Unknown facility value "' . $facility . '"');
}
return function ($info) use($ident, $facility) {
if (!openlog($ident, LOG_PID, $facility)) {
throw new \LogicException('Can\'t open syslog for ident "' . $ident . '" and facility "' . $facility . '"');
}
syslog(Syslog::$levels[$info['level']], vsprintf('%1$s: %4$s', $info));
closelog();
};
}
示例15: _log
function _log($text)
{
_trace($text);
openlog("alarm", LOG_PID | LOG_PERROR, LOG_LOCAL0);
syslog(LOG_DEBUG, var_export($text));
closelog();
}