本文整理汇总了PHP中app\models\Log::error方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::error方法的具体用法?PHP Log::error怎么用?PHP Log::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\models\Log
的用法示例。
在下文中一共展示了Log::error方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArticleAttribute
/**
* @return string
*/
protected function getArticleAttribute()
{
$path = $this->path;
$file = $this->file;
try {
return app('files')->get("{$path}/{$file}");
} catch (\Exception $e) {
\Log::error($e->getMessage());
}
return '';
}
示例2: getTestCatIdByName
/**
* Given the test category name we return the test category ID
*
* @param $testcategory - the name of the test category
*/
public static function getTestCatIdByName($testCategory)
{
try {
$testCatId = TestCategory::where('name', 'like', $testCategory)->firstOrFail();
return $testCatId->id;
} catch (ModelNotFoundException $e) {
Log::error("The test category ` {$testCategory} ` does not exist: " . $e->getMessage());
//TODO: send email?
return null;
}
}
示例3: idByName
/**
* Return field ID given the name
* @param $name the name of the field
*/
public static function idByName($name = NULL)
{
if ($name) {
try {
$field = Field::where('field_name', $name)->orderBy('field_name', 'asc')->firstOrFail();
return $field->id;
} catch (ModelNotFoundException $e) {
Log::error("The field ` {$name} ` does not exist: " . $e->getMessage());
//TODO: send email?
return null;
}
} else {
return null;
}
}
示例4: beforeSave
/**
* beforeSave.
*
* Validates before saving. Returns whether the Group can be saved.
*
* @param array $options
*
* @return bool
*/
private function beforeSave(array $options = array())
{
if (!$this->validate()) {
Log::error("Unable to validate group: ");
Log::error($this->getErrors()->toArray());
Log::error($this->attributes);
return false;
}
return true;
}
示例5: updateInventory
public function updateInventory($flightID, $flightWebsiteID, $event, $overReport = false)
{
$trackInventory = $overReport ? new TrackingOverInventory() : new TrackingInventory();
try {
$trackInventory->incTotalAdZoneInventory($flightID, $flightWebsiteID, $event);
$trackInventory = $overReport ? new TrackingOverInventory() : new TrackingInventory();
$trackInventory->incTotalInventory($flightID, $event);
return true;
} catch (Exception $exception) {
Log::error($exception);
throw $exception;
return false;
}
}
示例6: saveInstrument
/**
* Save instrument
*
* @param String machineCode, String ip, optional String hostname
* @return String success/failure message
*/
public static function saveInstrument($code, $ip, $hostname = "")
{
$plugin = Instrument::getInstalledPlugins(true);
$className = "";
// Get the class name of the user selected plugin
foreach ($plugin as $key => $plug) {
// If the instrument_code matches that of the select box, WE HAVE A MATCH
if ($key == $code) {
$className = $plug['class'];
break;
}
}
if (class_exists($className)) {
$instrument = new $className($ip);
$deviceInfo = $instrument->getEquipmentInfo();
$newInstrument = new Instrument();
$newInstrument->name = $deviceInfo['name'];
$newInstrument->description = $deviceInfo['description'];
$newInstrument->driver_name = $className;
$newInstrument->ip = $ip;
$newInstrument->hostname = Input::get('hostname');
try {
$newInstrument->save();
$newInstrument->setTestTypes($deviceInfo['testTypes']);
return trans('messages.success-creating-instrument');
} catch (QueryException $e) {
Log::error($e);
}
}
return trans('messages.failure-creating-instrument');
}
示例7: getMeasureIdByName
/**
* Given the measure name we return the measure ID
*
* @param $measureName the name of the measure
*/
public static function getMeasureIdByName($measureName)
{
try {
$measure = Measure::where('name', 'like', $measureName)->firstOrFail();
return $measure->id;
} catch (ModelNotFoundException $e) {
Log::error("The measure ` {$measureName} ` does not exist: " . $e->getMessage());
//TODO: send email?
return null;
}
}
示例8: getTestTypeIdByTestName
/**
* Given the test name we return the test type ID
*
* @param $testname the name of the test
*/
public static function getTestTypeIdByTestName($testName)
{
try {
$testName = trim($testName);
$testTypeId = TestType::where('name', 'like', $testName)->orderBy('name')->firstOrFail();
return $testTypeId->id;
} catch (ModelNotFoundException $e) {
\Log::error("The test type ` {$testName} ` does not exist: " . $e->getMessage());
//TODO: send email?
return null;
}
}