本文整理汇总了PHP中Log::Error方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::Error方法的具体用法?PHP Log::Error怎么用?PHP Log::Error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::Error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Connect
public function Connect()
{
$connected = false;
$attempts = 0;
$hosts = $this->options->Controllers();
$options = $this->options->AdLdapOptions();
while (!$connected && $attempts < count($hosts)) {
try {
$host = $hosts[$attempts];
Log::Debug('ActiveDirectory - Trying to connect to host %s', $host);
$options['domain_controllers'] = array($host);
$attempts++;
$this->ldap = new adLdap($options);
$connected = true;
if ($connected) {
Log::Debug('ActiveDirectory - Connection succeeded to host %s', $host);
} else {
Log::Debug('ActiveDirectory - Connection failed to host %s. Reason %s', $host, $this->ldap->getLastError());
}
} catch (adLDAPException $ex) {
Log::Error($ex);
throw $ex;
}
}
return $connected;
}
示例2: Handle
public static function Handle($exception)
{
Log::Error('Uncaught exception: %s', $exception);
if (isset(self::$handler)) {
self::$handler->HandleException($exception);
}
}
示例3: TryPageLoad
private function TryPageLoad($currentUser)
{
$fileId = $this->page->GetFileId();
$referenceNumber = $this->page->GetReferenceNumber();
Log::Debug('Trying to load reservation attachment. FileId: %s, ReferenceNumber %s', $fileId, $referenceNumber);
$attachment = $this->reservationRepository->LoadReservationAttachment($fileId);
if ($attachment == null) {
Log::Error('Error loading resource attachment, attachment not found');
return false;
}
$reservation = $this->reservationRepository->LoadByReferenceNumber($referenceNumber);
if ($reservation == null) {
Log::Error('Error loading resource attachment, reservation not found');
return false;
}
if ($reservation->SeriesId() != $attachment->SeriesId()) {
Log::Error('Error loading resource attachment, attachment not associated with reservation');
return false;
}
if (!$this->permissionService->CanAccessResource(new ReservationResource($reservation->ResourceId()), $currentUser)) {
Log::Error('Error loading resource attachment, insufficient permissions');
return false;
}
return $attachment;
}
示例4: UpdateTheme
public function UpdateTheme()
{
$logoFile = $this->page->GetLogoFile();
$cssFile = $this->page->GetCssFile();
if ($logoFile != null) {
Log::Debug('Replacing logo with ' . $logoFile->OriginalName());
$targets = glob(ROOT_DIR . 'Web/img/custom-logo.*');
foreach ($targets as $target) {
$removed = unlink($target);
if (!$removed) {
Log::Error('Could not remove existing logo. Ensure %s is writable.', $target);
}
}
$target = ROOT_DIR . 'Web/img/custom-logo.' . $logoFile->Extension();
$copied = copy($logoFile->TemporaryName(), $target);
if (!$copied) {
Log::Error('Could not replace logo with %s. Ensure %s is writable.', $logoFile->OriginalName(), $target);
}
}
if ($cssFile != null) {
Log::Debug('Replacing css file with ' . $cssFile->OriginalName());
$target = ROOT_DIR . 'Web/css/custom-style.css';
$copied = copy($cssFile->TemporaryName(), $target);
if (!$copied) {
Log::Error('Could not replace css with %s. Ensure %s is writable.', $cssFile->OriginalName(), $target);
}
}
}
示例5: RemoveFile
/**
* @param $fullPath string
* @return void
*/
public function RemoveFile($fullPath)
{
Log::Debug('Deleting file: %s', $fullPath);
if (unlink($fullPath) === false) {
Log::Error('Could not delete file: %s', $fullPath);
}
}
示例6: ProcessAction
public function ProcessAction()
{
try {
parent::ProcessAction();
} catch (Exception $ex) {
Log::Error('Error getting report: %s', $ex);
$this->page->DisplayError();
}
}
示例7: EnsureCommandLine
public static function EnsureCommandLine()
{
try {
if (array_key_exists('REQUEST_METHOD', $_SERVER)) {
die('This can only be accessed via the command line');
}
} catch (Exception $ex) {
Log::Error('Error in JobCop->EnsureCommandLine: %s', $ex);
}
}
示例8: Validate
public function Validate($username, $password)
{
try {
phpCAS::forceAuthentication();
} catch (Exception $ex) {
Log::Error('CAS exception: %s', $ex);
return false;
}
return true;
}
示例9: ProcessPageLoad
public function ProcessPageLoad()
{
$this->Set('EnableCaptcha', Configuration::Instance()->GetKey(ConfigKeys::REGISTRATION_ENABLE_CAPTCHA, new BooleanConverter()));
try {
$this->_presenter->PageLoad();
$this->Display('register.tpl');
} catch (Exception $ex) {
$this->Set('PageLoadException', true);
Log::Error('Error loading registration page %s', $ex);
}
}
示例10: Notify
/**
* @param $reservationSeries ReservationSeries|ExistingReservationSeries
* @return void
*/
public function Notify($reservationSeries)
{
$referenceNumber = $reservationSeries->CurrentInstance()->ReferenceNumber();
foreach ($this->notifications as $notification) {
try {
Log::Debug("Calling notify on %s for reservation %s", get_class($notification), $referenceNumber);
$notification->Notify($reservationSeries);
} catch (Exception $ex) {
Log::Error("Error sending notification of type %s for reservation %s. Exception: %s", get_class($notification), $referenceNumber, $ex);
}
}
}
示例11: __call
public function __call($func, $args)
{
if ($this->redis_ && method_exists($this->redis_, $func)) {
$r = new RunTimeUtil();
$ret = call_user_func_array(array($this->redis_, $func), $args);
$time = $r->spent();
Log::Info('cache', "#method:{$func}#args:" . json_encode($args) . "#ret:" . json_encode($ret) . "#runtime:{$time}");
return $ret;
} else {
Log::Error('cache', "#method{$func}#args" . json_encode($args) . "#message:no funcs or client is null");
return null;
}
}
示例12: __call
public final function __call($func, $args)
{
if ($this->_medoo && method_exists($this->_medoo, $func)) {
$r = new RunTimeUtil();
$ret = call_user_func_array(array($this->_medoo, $func), $args);
$time = $r->spent();
$logs = $this->_medoo->log();
Log::Info('db', "#method:{$func}#sql:" . end($logs) . "#ret:" . json_encode($ret) . "#runtime:{$time}");
return $ret;
} else {
Log::Error('db', "#method{$func}#args" . json_encode($args) . "#message:no funcs or client is null");
return null;
}
}
示例13: RemoveLogo
public function RemoveLogo()
{
try {
$targets = glob(ROOT_DIR . 'Web/img/custom-logo.*');
foreach ($targets as $target) {
$removed = unlink($target);
if (!$removed) {
Log::Error('Could not remove existing logo. Ensure %s is writable.', $target);
}
}
} catch (Exception $ex) {
Log::Error('Could not remove logos. %s', $ex);
}
}
示例14: Validate
public function Validate($username, $password)
{
try {
if ($_GET["doCAS"] == 1) {
phpCAS::forceAuthentication();
} else {
return parent::Validate($username, $password);
}
} catch (Exception $ex) {
Log::Error('CAS exception: %s', $ex);
return false;
}
return true;
}
示例15: Flush
public function Flush()
{
try {
$dirName = $this->GetDirectory();
$cacheDir = opendir($dirName);
while (false !== ($file = readdir($cacheDir))) {
if ($file != "." && $file != "..") {
unlink($dirName . $file);
}
}
closedir($cacheDir);
} catch (Exception $ex) {
Log::Error('Could not flush template cache directory: %s', $ex);
}
}