本文整理汇总了PHP中Log::useDailyFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::useDailyFiles方法的具体用法?PHP Log::useDailyFiles怎么用?PHP Log::useDailyFiles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::useDailyFiles方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* Register any application services.
*
* @return void
*/
public function register()
{
$this->app->bind('Illuminate\\Contracts\\Auth\\Registrar', 'App\\Services\\Registrar');
// ログのパーミッションはデフォルトで0644なので、cli経由、web経由でファイル名変えとく。
$logFile = PHP_SAPI . '.log';
// \Log::useDailyFiles(storage_path('logs/debug-' . $logFile)); // こっちは全部のログレベルを書き込むログ
\Log::useDailyFiles(storage_path('logs/error-' . $logFile), 'warning');
// こっちはwarning以上を書き込むログ
}
示例2: addPointsTrade
public function addPointsTrade($user_id, $amount_fee, $trade_id, $wallet_init)
{
$logFile = 'points.log';
Log::useDailyFiles(storage_path() . '/logs/points/' . $logFile);
$setting = new Setting();
$balance = new Balance();
$wallet = wallet::where('type', 'POINTS')->first();
$user = User::find($user_id);
Log::info("\n" . '------------------------- Add Point Trade -----------------------------');
Log::info("\n" . 'amount_fee ' . $amount_fee . ' . trade_id: ' . $trade_id . " -- wallet_init: " . $wallet_init);
if (isset($wallet->id)) {
$point_per_btc = $setting->getSetting('point_per_btc', 1);
$percent_point_reward_trade = $setting->getSetting('percent_point_reward_trade', 0);
$percent_point_reward_referred_trade = $setting->getSetting('percent_point_reward_referred_trade', 0);
Log::info("\n" . 'Setting -- point_per_btc: ' . $point_per_btc . ' . percent_point_reward_trade: ' . $percent_point_reward_trade . " % -- percent_point_reward_referred_trade: " . $percent_point_reward_referred_trade . " %");
//cong point cho $user_id
if ($percent_point_reward_trade > 0) {
$amount_reward = $amount_fee * $percent_point_reward_trade / 100;
$point_reward = $amount_reward / $point_per_btc;
Log::info("\n" . 'Add point for ' . $user->username . ' . amount_reward: ' . $amount_reward . " BTC -- point_reward: " . $point_reward . " POINTS");
if ($point_reward > 0) {
$balance->addMoney($point_reward, $wallet->id, $user->id);
$deposit = new Deposit();
$deposit->user_id = $user->id;
$deposit->wallet_id = $wallet->id;
$deposit->amount = $point_reward;
$deposit->paid = 1;
$deposit->transaction_id = "Points earned from trade " . $trade_id;
$deposit->save();
}
}
//cong point cho nguoi da gioi thieu $user_id nay neu co
if (!empty($user->referral) && $percent_point_reward_referred_trade > 0) {
$user_referred = User::where('username', $user->referral)->first();
if (!empty($user_referred)) {
$amount_reward = $amount_fee * $percent_point_reward_referred_trade / 100;
$point_reward = $amount_reward / $point_per_btc;
Log::info("user_referred AAAAAAAAA: ", $user_referred);
Log::info("\n" . 'Add point for user referred: ' . $user_referred->username . ' . amount_reward: ' . $amount_reward . " BTC -- point_reward: " . $point_reward . " POINTS");
if ($point_reward > 0) {
$balance->addMoney($point_reward, $wallet->id, $user_referred->id);
$deposit = new Deposit();
$deposit->user_id = $user_referred->id;
$deposit->wallet_id = $wallet->id;
$deposit->amount = $point_reward;
$deposit->paid = 1;
$deposit->transaction_id = "Points earned from User " . $user->username . "( Trade: " . $trade_id . ")";
$deposit->save();
}
}
}
} else {
Log::info("\n" . 'No wallet POINTS');
}
}
示例3: php_sapi_name
<?php
// Error Logger
$logFile = 'log-' . php_sapi_name() . '.log';
Log::useDailyFiles(LOGS_PATH . $logFile);
示例4: sprintf
|--------------------------------------------------------------------------
|
| Here we will load this Illuminate application. We will keep this in a
| separate location so we can isolate the creation of an application
| from the actual running of the application with a given request.
|
*/
$framework = $app['path.base'] . '/vendor/laravel/framework/src';
require $framework . '/Illuminate/Foundation/start.php';
/*
|--------------------------------------------------------------------------
| Use daily log files
|--------------------------------------------------------------------------
|
| Here we will set the logger to use daily log files instead of using
| one large file
|
*/
$logPath = sprintf(storage_path('logs/%s'), 'laravel.log');
Log::useDailyFiles($logPath);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
示例5: app_path
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/
$logLevel = 'production' == App::environment() ? 'warning' : 'debug';
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile, 0, $logLevel);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
});
示例6: app_path
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a basic log file setup which creates a single file for logs.
|
*/
$logFile = 'atlas.log';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile, 7, 'warning');
if (App::environment() == 'local') {
$monolog = Log::getMonolog();
$monolog->pushHandler(new \Monolog\Handler\ChromePHPHandler());
}
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
示例7: app_path
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a basic log file setup which creates a single file for logs.
|
*/
Log::useDailyFiles(storage_path() . '/logs/log', 10);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
});
示例8: php_sapi_name
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array());
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::missing(function ($exception) {
return Response::view('errors.missing', [], 404);
});
示例9: app_path
| load your controllers and models. This is useful for keeping all of
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a basic log file setup which creates a single file for logs.
|
*/
Log::useDailyFiles(Locker\Helpers\Helpers::getEnvVar('LOG_FILESTORE'));
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
});
示例10: doCancel
public function doCancel()
{
if (Auth::guest()) {
echo json_encode(array('status' => 'error', 'message' => Lang::get('messages.login_to_buy')));
exit;
}
$logFile = 'trades.log';
Log::useDailyFiles(storage_path() . '/logs/trades/' . $logFile);
Log::info('------------------------- Do Cancel -----------------------------');
$user = Confide::user();
$balance = new Balance();
$order_id = $_POST['order_id'];
$orders = Order::find($order_id);
if ($orders->user_id == $user->id && in_array($orders->status, $orders->getStatusActive())) {
//this condition use to avoid case a user cancel order of other user
//message_socket for update data not f5
$message_socket['market_id'] = $orders->market_id;
$message_socket_temp = array('id' => $orders->id, 'amount' => $orders->from_value, 'total' => $orders->to_value, 'action' => "update", 'price' => $orders->price);
//refund money for user
//get info market
$market_default = Market::find($orders->market_id);
$wallet_from = $market_default->wallet_from;
$wallet_to = $market_default->wallet_to;
$wallet = new Wallet();
$from = $wallet->getType($wallet_from);
$to = $wallet->getType($wallet_to);
$value_refund = 0;
$type_money_refund = '';
if ($orders->type == 'buy') {
//if buy: refund to_value to to_type_money (eg. Market BTC-> USD => refund to USD wallet)
$value_refund = $orders->to_value;
$type_money_refund = $wallet_to;
$coin_code = $to;
$message_socket['order_b'] = $message_socket_temp;
$message_socket['order_b']['type'] = 'buy';
} else {
//if sell: refund from_value to from_type_money (eg. Market BTC-> USD => refund to BTC wallet)
$value_refund = $orders->from_value;
$type_money_refund = $wallet_from;
$coin_code = $from;
$message_socket['order_s'] = $message_socket_temp;
$message_socket['order_s']['type'] = 'sell';
}
$balance->addMoney($value_refund, $type_money_refund, $user->id);
//delete order
$orders->delete();
echo json_encode(array('status' => 'success', 'message_socket' => $message_socket, 'message' => Lang::get('messages.cancel_successfull', array('value' => $value_refund, 'coin' => strtoupper($coin_code)))));
exit;
} else {
echo json_encode(array('status' => 'error', 'message' => Lang::get('messages.not_your_order')));
exit;
}
}
示例11: blocknotifyUpdateDeposit
public function blocknotifyUpdateDeposit($wallet_type = '')
{
$blockhash = isset($_GET['trxhash']) ? $_GET['trxhash'] : 0;
$logFile = 'laravel_' . $wallet_type . '.log';
Log::useDailyFiles(storage_path() . '/logs/callbackdeposits/' . $logFile);
Log::info("*******New Blocknotify Update Deposit: " . $blockhash . " -- wallet_type: " . $wallet_type);
Log::info("\n" . "-- wallet_type: " . $wallet_type);
if ($wallet_type != '') {
$wallet = Wallet::where('type', strtoupper($wallet_type))->first();
$wallet->connectJsonRPCclient($wallet->wallet_username, $wallet->wallet_password, $wallet->wallet_ip, $wallet->port);
$limit_confirmations = empty($wallet->limit_confirmations) || $wallet->limit_confirmations <= 0 ? 3 : $wallet->limit_confirmations;
$listtrans = $wallet->getListTransactions();
@Log::info("\n" . 'Result listtrans: ', $listtrans);
$balance = new Balance();
foreach ($listtrans as $key => $value) {
try {
$transaction_id = $value['txid'];
$trans = $wallet->getTransaction($transaction_id);
if ($trans != null) {
$account = $trans["details"][0]["account"];
$category = $trans["details"][0]["category"];
$confirms = $trans["confirmations"];
//send,receive
$address_ = $trans["details"][0]["address"];
$amount = $trans["amount"];
Log::info("\n" . "transaction: ", $trans);
Log::info("\n" . "------Account: " . $account . " -- category:" . $category . " --address: " . $address_);
//mail("ntngocthuy88@gmail.com", 'Deposit Cron: ', var_export($trans, true));
$deposit = Deposit::where('transaction_id', $transaction_id)->first();
$user = User::where('username', $account)->first();
if (isset($deposit->transaction_id)) {
if ($deposit->paid == 0) {
if ($category == "receive" && $confirms >= $limit_confirmations && isset($user->id)) {
Deposit::where('id', $deposit->id)->update(array('paid' => 1, 'confirmations' => $confirms));
$balance->addMoney($amount, $wallet->id, $user->id);
$message .= "<br>" . $amount . " " . $wallet->type . " was credited to your account";
Log::info("\n" . $amount . " " . $wallet->type . " was credited to your account");
}
} else {
Deposit::where('id', $deposit->id)->update(array('confirmations' => $confirms));
Log::info("\n" . $amount . " " . $wallet->type . " was already credited to your account. contact support if you need further assistance.");
}
} else {
if ($category == "receive" && isset($user->id)) {
if ($confirms >= $limit_confirmations) {
Deposit::insert(array('user_id' => $user->id, 'wallet_id' => $wallet->id, 'transaction_id' => $transaction_id, 'amount' => $amount, 'paid' => 1, 'confirmations' => $confirms, 'address' => $address_, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')));
$balance->addMoney($amount, $wallet->id, $user->id);
Log::info("\n" . $amount . " " . $wallet->type . " was credited to your account");
} else {
Deposit::insert(array('user_id' => $user->id, 'wallet_id' => $wallet->id, 'transaction_id' => $transaction_id, 'amount' => $amount, 'paid' => 0, 'confirmations' => $confirms, 'address' => $address_, 'created_at' => date('Y-m-d H:i:s'), 'updated_at' => date('Y-m-d H:i:s')));
Log::info("\n" . "This Deposit is unconfirmed. Current confirmations:" . $confirms . ". Required : 3.");
}
} else {
Log::info("\n" . "transaction is not a deposit or account is invalid.");
}
}
} else {
Log::info("\n" . "We can't find any information about this deposit. contact support.");
}
//trans
} catch (Exception $e) {
Log::info('Caught exception: ' . $e->getMessage() . "\n");
}
}
} else {
Log::info('------------------- Error: not param wallet_type from _GET');
}
Log::info("*******Stop New Blocknotify Update Deposit*************");
}
示例12: app_path
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a basic log file setup which creates a single file for logs.
|
*/
// Log::useFiles(storage_path().'/logs/laravel.log');
Log::useDailyFiles(storage_path() . '/logs/admin.log');
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
require app_path() . '/lib/system/error.php';
require app_path() . '/lib/system/event.php';
/*
示例13: app_path
use Monolog\Logger;
use Monolog\Handler\NativeMailerHandler;
use Illuminate\Support\Facades\App;
ClassLoader::addDirectories(array(app_path() . '/commands', app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(storage_path() . '/logs/' . $logFile, $days = 0, $level = 'debug');
//set email log
$to = Config::get('log.to_email');
$from = Config::get('log.from_email');
if (!empty($to) && !empty($from)) {
$subject = 'openstackid error';
$mono_log = Log::getMonolog();
$handler = new NativeMailerHandler($to, $subject, $from, $level = Logger::WARNING);
$mono_log->pushHandler($handler);
}
if (Config::get('database.log', false)) {
Event::listen('illuminate.query', function ($query, $bindings, $time, $name) {
$data = compact('bindings', 'time', 'name');
// Format binding data for sql insertion
foreach ($bindings as $i => $binding) {
if ($binding instanceof \DateTime) {
示例14:
<?php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/
Log::useDailyFiles(__DIR__ . '/../storage/logs/log.txt');
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
示例15: app_path
| your classes in the "global" namespace without Composer updating.
|
*/
ClassLoader::addDirectories(array(app_path() . '/controllers', app_path() . '/models', app_path() . '/database/seeds'));
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
| is built on top of the wonderful Monolog library. By default we will
| build a rotating log file setup which creates a new file each day.
|
*/
$logFile = 'log-' . php_sapi_name() . '.txt';
Log::useDailyFiles(__DIR__ . '/../storage/logs/' . $logFile);
/*
|--------------------------------------------------------------------------
| Application Error Handler
|--------------------------------------------------------------------------
|
| Here you may handle any errors that occur in your application, including
| logging them or displaying custom views for specific errors. You may
| even register several error handlers to handle different types of
| exceptions. If nothing is returned, the default error view is
| shown, which includes a detailed stack trace during debug.
|
*/
App::error(function (Exception $exception, $code) {
Log::error($exception);
});