本文整理汇总了PHP中Illuminate\Support\Facades\Log::info方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::info方法的具体用法?PHP Log::info怎么用?PHP Log::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Support\Facades\Log
的用法示例。
在下文中一共展示了Log::info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
public function boot()
{
if (!($model = $this->getModelClass())) {
return;
}
parent::boot();
// Flush nested set caches related to the object
if (Config::get('app.debug')) {
Log::info('Binding heirarchical caches', ['model' => $model]);
}
// Trigger save events after move events
// Flushing parent caches directly causes an infinite recursion
$touch = function ($node) {
if (Config::get('app.debug')) {
Log::debug('Touching parents to trigger cache flushing.', ['parent' => $node->parent]);
}
// Force parent caches to flush
if ($node->parent) {
$node->parent->touch();
}
};
$model::moved($touch);
// Flush caches related to the ancestors
$flush = function ($node) {
$tags = $this->make($node)->getParentTags();
if (Config::get('app.debug')) {
Log::debug('Flushing parent caches', ['tags' => $tags]);
}
Cache::tags($tags)->flush();
};
$model::saved($flush);
$model::deleted($flush);
}
示例2: getOrder
/**
* Listens for and stores PayPal IPN requests.
*
* @throws InvalidIpnException
*
* @return IpnOrder
*/
public function getOrder()
{
$ipnMessage = null;
$listenerBuilder = new ListenerBuilder();
if ($this->getEnvironment() == 'sandbox') {
$listenerBuilder->useSandbox();
// use PayPal sandbox
}
$listener = $listenerBuilder->build();
$listener->onVerified(function (MessageVerifiedEvent $event) {
$ipnMessage = $event->getMessage();
Log::info('IPN message verified - ' . $ipnMessage);
$this->order = $this->store($ipnMessage);
});
$listener->onInvalid(function (MessageInvalidEvent $event) {
$report = $event->getMessage();
Log::warning('Paypal returned invalid for ' . $report);
});
$listener->onVerificationFailure(function (MessageVerificationFailureEvent $event) {
$error = $event->getError();
// Something bad happend when trying to communicate with PayPal!
Log::error('Paypal verification error - ' . $error);
});
$listener->listen();
return $this->order;
}
示例3: index
/**
* 处理微信调用的请求
*/
public function index()
{
$message = file_get_contents("php://input");
Log::info($message);
$message = simplexml_load_string($message, 'SimpleXMLElement', LIBXML_NOCDATA);
if ($message) {
$msgType = $message->MsgType;
$fromUser = $message->FromUserName;
$content = $message->Content;
if ($msgType == self::WX_MSG_TYPE_TEXT) {
//处理用户文字
return $this->handleUserMassage($message);
}
if ($msgType == self::WX_MSG_TYPE_EVENT) {
if ($message->Event == self::WX_MSG_EVENT_SUBSCRIBE) {
//处理用户订阅事件
return $this->handleSubscribeEvent($message);
}
if ($message->Event == self::WX_MSG_EVENT_CLICK) {
if ($message->EventKey == self::WX_MENU_KEY_ABOUT_XY) {
//处理用户点击关于菜单事件
return $this->handleClickAboutMenu($message);
}
}
}
\Log::info("msgType = {$msgType}");
}
return "";
}
示例4: store
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
//
$inputs = $request->all();
rainsensor::create(['raining' => $inputs['rainSensor']]);
Log::info($inputs);
}
示例5: save
public function save($diskName, $destination, $uploadFile = array())
{
$this->init($diskName, $destination, $uploadFile);
if ($this->checkSameNameFile()) {
if ($this->checkUploadFileMd5()) {
return UPLOAD_FILE_EXIST;
}
return UPLOAD_FILE_SAME_NAME_DIFFERENT_CONTENT;
}
if ($this->checkChunk()) {
return UPLOAD_CHUNK_FILE_EXIST;
}
if (!$this->moveFile()) {
// Move the upload file to the target directory
return UPLOAD_CHUNK_FILE_FAILURE;
}
// Get all chunks
$chunkfiles = $this->disk->files($this->chunkFile['targetPath']);
// check the file upload finished
if (count($chunkfiles) * $this->chunkFile['fileSize'] >= $this->saveFile['fileSize'] - $this->chunkFile['fileSize'] + 1) {
if (!$this->createFileFromChunks($chunkfiles)) {
return UPLOAD_FILE_FAILURE;
}
Log::info('-------------------------------------------------------');
Log::info(__CLASS__ . ': save ' . $this->saveFile['fileRealPath'] . ' successfully!');
Log::info('-------------------------------------------------------');
return UPLOAD_FILE_SUCCESS;
}
return UPLOAD_CHUNK_FILE_SUCCESS;
}
示例6: boot
public function boot()
{
Event::listen('illuminate.query', function ($query, $params, $time, $conn) {
Log::info($query);
});
$this->app['router']->post('datagridview', '\\mkdesignn\\datagridview\\DataGridViewController@postIndex');
}
示例7: runProcess
private function runProcess($processName)
{
// use this code to run a bat file
$processFilename = $processName . '.bat';
exec('C:\\xampp\\htdocs\\smart\\process\\' . $processFilename);
Log::info('Running process: ' . $processName);
}
示例8: boot
/**
* Bootstrap any application services.
*
* 这里面能做很多跟监控有关的事情
*
* @return void
*/
public function boot()
{
// 监听数据库查询 打印LOG
DB::listen(function ($sql, $bindings, $time) {
Log::info('query db' . $sql . ' and the time is ' . $time);
});
}
示例9: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
Log::info('Begin the check-cycle-bill command.');
$now = Carbon::now();
$cycleBillList = CompanyCycleBill::where('next_date', '>=', $now->format('Y-m-01 00:00:00'))->where('next_date', '<=', $now->format('Y-m-31 23:59:59'))->get();
foreach ($cycleBillList as $cycleBill) {
$companyBill = new CompanyBill();
$item = $cycleBill->item;
if ($cycleBill->rule = '1m') {
$item = $item . "(" . $now->month . "月)";
} elseif ($cycleBill->rule = '3m') {
$item = $item . "(" . (int) ($now->month / 4 + 1) . "季度)";
} elseif ($cycleBill->rule = '12m') {
$item = $item . "(" . $now->year . "年)";
}
$companyBill->item = $item;
$companyBill->user_id = $cycleBill->user_id;
$companyBill->remarks = $cycleBill->remarks;
$companyBill->company_id = $cycleBill->company_id;
$companyBill->operator_id = $cycleBill->operator_id;
$companyBill->grand_total = $cycleBill->grand_total;
$companyBill->deadline = $cycleBill->next_date;
$companyBill->cycle_bill_id = $cycleBill->id;
$companyBill->save();
$cycleBill->next_date = $cycleBill->next_date->addMonth(intval($cycleBill->rule));
$cycleBill->save();
}
Log::info('End the check-cycle-bill command.');
}
示例10: fire
/**
* Execute the console command.
*
* @return mixed
*/
public function fire()
{
// Check not 'sync'
if (Config::get('queue.default') == "sync") {
Artisan::call('down');
$this->info("Application maintenance mode enabled.");
return;
}
// Push job onto queue
Queue::push(function ($job) {
// Take Application down.
Artisan::call('down');
// Add Log message
Log::info("Application is down, pausing queue while maintenance happens.");
// Loop, waiting for app to come back up
while (App::isDownForMaintenance()) {
echo ".";
sleep(5);
}
// App is back online, kill worker to restart daemon.
Log::info("Application is up, rebooting queue.");
Artisan::call('queue:restart');
$job->delete();
});
// Wait until Maintenance Mode enabled.
while (!App::isDownForMaintenance()) {
sleep(1);
}
$this->info("Application maintenance mode enabled.");
}
示例11: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
Log::info('Iniciando proceso de actualizacion de referencia de ventas');
$sales = Sales::where('transaction_id', '-1')->get();
foreach ($sales as $sale) {
$ventasPorAplicar = DB::table('contabilidad_sales')->select('*')->whereRaw('credit_debit = ? and reference = ? ', ['credit', $sale->reference])->where('transaction_id', '<>', '-1')->groupBy('reference')->get();
if (count($ventasPorAplicar) > 0) {
// se encontraron referencias de venta nuevas
foreach ($ventasPorAplicar as $ventaPorAplicar) {
$depositoAplicacionAnterior = DepositoAplicacion::where('venta_id', $sale->id)->get();
foreach ($depositoAplicacionAnterior as $depositoAplicacion) {
echo $depositoAplicacion->cantidad . ' ' . $depositoAplicacion->deposito_id . ' -- ' . $ventaPorAplicar->ammount . '-- ' . $ventaPorAplicar->ammount_applied . '-------';
if ($depositoAplicacion->estatus == 1) {
$deposito = new DepositoAplicacion(['deposito_id' => $depositoAplicacion->deposito_id, 'venta_id' => $ventaPorAplicar->id, 'estatus' => $depositoAplicacion->estatus, 'usuario_id' => $depositoAplicacion->usuario_id, 'cantidad' => $depositoAplicacion->cantidad]);
$ventaPorAplicar->ammount_applied = $depositoAplicacion->cantidad + ($ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied);
} else {
if (abs($depositoAplicacion->cantidad) >= $ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied) {
$ventaPorAplicar->ammount_applied = $depositoAplicacion->ammount;
$depositoAplicacion->cantidad = $depositoAplicacion->cantidad - ($ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied);
} else {
$ventaPorAplicar->ammount_applied = $ventaPorAplicar->ammount - $ventaPorAplicar->ammount_applied - $depositoAplicacion->cantidad;
$depositoAplicacion->cantidad = 0;
}
$deposito = new DepositoAplicacion(['deposito_id' => $depositoAplicacion->deposito_id, 'venta_id' => $ventaPorAplicar->id, 'estatus' => $depositoAplicacion->estatus, 'usuario_id' => $depositoAplicacion->usuario_id, 'cantidad' => -1 * ($ventaPorAplicar->ammount_applied - $ventaPorAplicar->ammount)]);
}
$deposito->save();
${$ventaPorAplicar}->update();
$depositoAplicacion->delete();
}
}
}
}
Log::info('Finalizando proceso de actualizacion de referencia de ventas');
}
示例12: finalizarCarrinho
/**
* Finaliza o pedido recebendo a mesa como parametro da requisicao
* abre o pedido, salva, e salva os itens no pedido.
* @param Request $request
*/
public function finalizarCarrinho(Request $request)
{
$itens = Cart::content();
$pedido = new Pedido();
$pedido->mesa = $request->mesa;
$pedido->total = Cart::total();
if (Cart::count() != 0) {
$pedido->save();
} else {
Flash::success("Por favor, adicione algum item no pedido!");
}
Log::info($pedido);
//por enquanto vai ser assim, mas pense numa maneira melhor
//de retornar o pedido criado.
$pedidoAtual = Pedido::orderBy('id', 'desc')->first();
$itensPedidos = array();
foreach ($itens as $iten) {
$itemPedido = new ItemPedido();
$itemPedido->nome = $iten->name;
$itemPedido->preco = $iten->price;
$itemPedido->quantidade = $iten->qty;
$itensPedidos[] = $itemPedido;
}
if (Cart::count() != 0) {
$pedidoAtual->itens()->saveMany($itensPedidos);
$pedidoAtual->save();
Cart::destroy();
Flash::success("Pedido finalizado!");
} else {
Flash::error("Por favor, adicione algum item no pedido!");
}
return redirect()->back();
}
示例13: getOAuth2AccessToken
/**
* 通过code换取网页授权access_token
* {
* "access_token": "OezXcEiiBSKSxW0eoylIeLbTirX__QgA7uW8WJE0Z2izAbnXV7DHbdHni-j9OoCq2Xqh5gLlPt0uAHtfYByOH80h1dwMrq74iALd_K359JYEN5KWKB7_sEz3T19V86sP9lSO5ZGbc-qoXUD3XZjEPw",
* "expires_in": 7200,
* "refresh_token": "OezXcEiiBSKSxW0eoylIeLbTirX__QgA7uW8WJE0Z2izAbnXV7DHbdHni-j9OoCqgBFR_ApctbH4Tk5buv8Rr3zb7T3_27zZXWIdJrmbGFoFzGUfOvnwX249iPoeNJ2HYDbzW5sEfZHkC5zS4Qr8ug",
* "openid": "oMzBIuI7ctx3n-kZZiixjchzBKLw",
* "scope": "snsapi_base"
* }
**/
public function getOAuth2AccessToken(Request $request)
{
$code = $request->input('code');
$res = AccessTokenService::getOAuth2AccessToken($code);
Log::info($res);
return response($res)->header('Content-Type', 'JSON');
}
示例14: updateCommand
function updateCommand($git, $branch, $location, $domainId)
{
return Remote::run(['cd ' . base_path() . '; ~/.composer/vendor/bin/envoy run update --git=' . $git . ' --branch=' . $branch . ' --location=' . $location], function ($line) {
Log::info($line);
echo $line . '<br />';
});
}
示例15: verifyNotify
/**
* 针对notify_url验证消息是否是支付宝发出的合法消息
* @return 验证结果
*/
function verifyNotify()
{
if (empty($_POST)) {
//判断POST来的数组是否为空
return false;
} else {
//生成签名结果
$isSign = $this->getSignVerify($_POST, $_POST["sign"], true);
//获取支付宝远程服务器ATN结果(验证是否是支付宝发来的消息)
$responseTxt = 'true';
if (!empty($_POST["notify_id"])) {
$responseTxt = $this->getResponse($_POST["notify_id"]);
}
//写日志记录
if ($this->alipay_config['log'] || true) {
if ($isSign) {
$isSignStr = 'true';
} else {
$isSignStr = 'false';
}
$log_text = "[===AliPay Notify===]responseTxt=" . $responseTxt . "\n notify_url_log:isSign=" . $isSignStr . "\n";
$log_text = $log_text . $this->createLinkString($_POST);
Log::info($log_text);
}
//验证
//$responseTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关
//isSign的结果不是true,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关
if (preg_match("/true\$/i", $responseTxt) && $isSign) {
return true;
} else {
return false;
}
}
}