本文整理汇总了PHP中Logging::logException方法的典型用法代码示例。如果您正苦于以下问题:PHP Logging::logException方法的具体用法?PHP Logging::logException怎么用?PHP Logging::logException使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging
的用法示例。
在下文中一共展示了Logging::logException方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onResponseSent
public function onResponseSent()
{
if (!$this->settings->hasSetting("debug_log") or !$this->environment->request()) {
return;
}
$path = $this->environment->request()->path();
if (count($path) > 0 and strcasecmp($path[0], "debug") == 0) {
return;
}
$log = $this->settings->setting("debug_log");
$handle = @fopen($log, "a");
if (!$handle) {
Logging::logError("Could not write to log file: " . $log);
return;
}
$trace = Logging::getTrace();
try {
foreach ($trace as $d) {
fwrite($handle, Util::toString($d));
}
fclose($handle);
} catch (Exception $e) {
Logging::logError("Could not write to log file: " . $log);
Logging::logException($e);
}
}
示例2: globalExceptionHandler
function globalExceptionHandler($e)
{
global $responseHandler;
Logging::logException($e);
Logging::logDebug(Util::array2str(debug_backtrace()));
if ($responseHandler == NULL) {
$responseHandler = new ResponseHandler(new OutputHandler());
}
$responseHandler->unknownServerError($e->getMessage());
die;
}
示例3: onError
public function onError($e)
{
Logging::logException($e);
}
示例4: put
public function put($data)
{
if ($data == NULL) {
Logging::logDebug("Ignoring empty update");
return;
}
checkUploadSize();
$oldSize = $this->file->exists() ? $this->file->size() : NULL;
$size = isset($_SERVER['CONTENT_LENGTH']) ? $_SERVER['CONTENT_LENGTH'] : NULL;
Logging::logDebug("Update " . $size);
if ($size == 0) {
Logging::logDebug("Ignoring empty update");
return;
}
try {
$this->env->filesystem()->updateFileContents($this->file, $data, $size);
} catch (Exception $e) {
Logging::logException($e);
if ($oldSize != 0 and $this->env->request()->isWindowsClient()) {
// windows tries to clean up interrupted overwrite
// for existing files this is not acceptable, ignore later delete request
Logging::logDebug("File update failed, marking delete ignore");
$this->env->session()->setValue("ignore_delete_" . $this->file->id(), "" . time());
}
throw new Sabre_DAV_Exception_Forbidden();
}
}
示例5: catch
$env->authentication()->setAuth($user);
}
$command = $opts["commands"][0];
if (!$env->commands()->exists($command)) {
echo "Invalid command: " . $command . "\n";
return;
}
echo "Command [" . $command . "]\n";
//TODO allow command registrations from plugins etc
try {
$env->commands()->execute($command, $options);
} catch (ServiceException $e) {
Logging::logException($e);
echo "ERROR: " . $e->type() . " " . $e->details() . " (" . Util::array2str($e->data()) . ")\n";
} catch (Exception $e) {
Logging::logException($e);
echo "ERROR: " . $e->getMessage() . "\n";
}
// TOOLS
function getOpts($args)
{
array_shift($args);
$endofoptions = false;
$ret = array('commands' => array(), 'options' => array(), 'flags' => array(), 'arguments' => array());
while ($arg = array_shift($args)) {
// if we have reached end of options,
//we cast all remaining argvs as arguments
if ($endofoptions) {
$ret['arguments'][] = $arg;
continue;
}