本文整理汇总了PHP中Illuminate\Log\Writer::useFiles方法的典型用法代码示例。如果您正苦于以下问题:PHP Writer::useFiles方法的具体用法?PHP Writer::useFiles怎么用?PHP Writer::useFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Log\Writer
的用法示例。
在下文中一共展示了Writer::useFiles方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: useFiles
public function useFiles($path, $level = 'debug')
{
if (Config::get('app.sae')) {
return $this->useSaeLog($level);
}
parent::useFiles($path, $level);
}
示例2: loger
function loger($level, $file, $line, $string, $ar = NULL)
{
// если системный level ниже notice, то при включеном KINT_DUMP, ставим уровень notice
if ($GLOBALS['KINT_DUMP'] && $this->agiconfig['verbosity_level'] < 2) {
$this->agiconfig['verbosity_level'] = 2;
}
if ($this->agiconfig['verbosity_level'] < $level) {
return;
}
if ($GLOBALS['KINT_DUMP']) {
~d("{$level} | {$file} | {$line}");
if (!is_null($string)) {
d($string);
}
if (!is_null($ar)) {
d($ar);
}
return;
}
if (!is_null($string)) {
$this->agi->verbose($string);
}
if (!is_null($ar)) {
$this->agi->verbose($ar);
}
if ((int) $this->agiconfig['logging_write_file'] === 1) {
$logger = new Writer(new Logger('local'));
$logger->useFiles($this->config['logs_patch']);
if (!is_null($ar)) {
$string .= "\n";
$string .= var_export($string, true);
}
switch ($level) {
case 'error':
$logger->error("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
break;
case 'warning':
$logger->warning("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
break;
case 'notice':
$logger->notice("[" . $this->uniqueid . "] [{$file}] [{$line}]: -- {$string}");
break;
case 'info':
$logger->info("[" . $this->uniqueid . "] [{$file}] [{$line}]: {$string}");
break;
default:
$logger->debug("[" . $this->uniqueid . "] [{$file}] [{$line}]: {$string}");
break;
}
}
}
示例3: notify
/**
* PayFast notify
*
* @param Request $request
* @param Writer $logger
*
* @return Response
*/
public function notify(Request $request, Writer $logger)
{
//Notify Payfast
header('HTTP/1.0 200 OK');
flush();
$logger->useFiles('payFast.txt');
if ($request->method() !== 'POST') {
$logger->error('Error -- POST variables not set');
exit;
}
$logger->debug("Posted Variables --\n" . implode("\n", array_filter($request->input(), function ($value) {
return !empty($value);
})) . "\n");
$payFastData = $this->cleanPostVariables($request->input());
$serialisedPayFastData = $this->serialisePostVariables($payFastData);
$signature = $request->input('signature');
if ($signature === null) {
$logger->error("Error -- Signature not set \n");
exit;
}
if (!$this->hasValidSignature($signature, $serialisedPayFastData)) {
$output = "Error -- Signature mismatch\n\n";
$output .= "Security Signature:\n\n";
$output .= "\t- posted = " . $signature . "\n";
$output .= "\t- calculated = " . $serialisedPayFastData . "\n";
$output .= "\t- result = " . $payFastData['payment_status'] . "\n";
$logger->error($output);
exit;
}
Transaction::create($request->input());
if (!$this->isValidPayfastHost($request)) {
$logger->error('Invalid PayFast IP Address');
exit;
}
$pfHost = self::SANDBOX_MODE ? 'sandbox.payfast.co.za' : 'www.payfast.co.za';
$hostUrl = 'https://' . $pfHost . '/eng/query/validate';
if (in_array('curl', get_loaded_extensions())) {
$response = $this->checkPaymentStatusCurl($hostUrl, $serialisedPayFastData);
} else {
$response = $this->checkPaymentStatusHttp($pfHost, $serialisedPayFastData);
}
$lines = explode("\r\n", $response);
$verifyResult = trim($lines[0]);
if (strcasecmp($verifyResult, 'VALID') != 0) {
$logger->error('Error -- Data not valid');
die;
}
$this->updateOrderStatus($request, $logger, $payFastData);
}
示例4: sysmessage
public function sysmessage(Request $request, Crypt $crypt)
{
$logger = new Writer(new Logger("output"));
$logger->useFiles('php://stdout');
$raw = $GLOBALS['HTTP_RAW_POST_DATA'];
$logger->info('raw post:');
$logger->info(var_export($raw, true));
$data = $this->process($raw);
$logger->info(var_export($data, true));
// $errCode = $crypt->decryptMsg($raw->ComponentVerifyTicket, $raw->CreateTime, $nonce, $from_xml, $msg);
echo 'success';
return;
/*
if ($errCode == 0) {
$logger->info('after decrypt:');
$logger->info(var_export($msg, true));
} else {
$logger->info('Err: '.$errCode);
}
*/
echo 'success';
}
示例5: useFiles
/**
* Register a file log handler.
*
* @param string $path
* @param string $level
* @return void
* @static
*/
public static function useFiles($path, $level = 'debug')
{
\Illuminate\Log\Writer::useFiles($path, $level);
}
示例6: configureSingleHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureSingleHandler(Application $app, Writer $log)
{
$log->useFiles($app->storagePath() . '/logs/laravel.log');
}
示例7: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot(Writer $logger)
{
$logger->useFiles('php://stdout');
}
示例8: configureAppenginemvmHandler
/**
* Custom Monolog handler that for AppEngine ManagedVMs.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
*
* @return void
*/
protected function configureAppenginemvmHandler(Application $app, Writer $log)
{
// Log to designated
$log->useFiles($app->storagePath() . '/logs/laravel.log');
$log->useFiles('/var/log/app_engine/custom_logs/laravel.log');
}
示例9: configureSingleHandler
/**
* @param \Illuminate\Contracts\Foundation\Application|\Notadd\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
*
* @return void
*/
protected function configureSingleHandler(Application $app, Writer $log)
{
$log->useFiles($app->storagePath() . '/logs/laravel.log', $app->make('config')->get('app.log_level', 'debug'));
}
示例10: function
use Illuminate\Mail\Transport\LogTransport;
use Illuminate\Filesystem\Filesystem;
use Illuminate\View\Engines\PhpEngine;
use Illuminate\View\Engines\EngineResolver;
use Illuminate\View\FileViewFinder;
use Illuminate\View\Factory;
use Illuminate\Events\Dispatcher;
use Illuminate\Mail\Mailer;
use Illuminate\Log\Writer;
use Monolog\Logger;
$app = new \Slim\Slim();
$app->add(new \Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware());
$app->get('/', function () {
$logger = new Writer(new Logger('local'));
// note: make sure log file is writable
$logger->useFiles('../../logs/laravel.log');
// chose a transport (SMTP, PHP Mail, Sendmail, Mailgun, Maindrill, Log)
$transport = SmtpTransport::newInstance(getenv('SMTP_HOST'), getenv('SMTP_PORT'));
// $transport = MailTransport::newInstance();
// $transport = SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
// $transport = new MailgunTransport(getenv('MAILGUN_SECRET'), getenv('MAILGUN_DOMAIN'));
// $transport = new MandrillTransport(getenv('MANDRILL_SECRET'));
// $transport = new LogTransport($logger->getMonolog());
// SMTP specific configuration, remove these if you're not using SMTP
$transport->setUsername(getenv('SMTP_USERNAME'));
$transport->setPassword(getenv('SMTP_PASSWORD'));
$transport->setEncryption(true);
$swift = new SwiftMailer($transport);
$finder = new FileViewFinder(new Filesystem(), ['views']);
$resolver = new EngineResolver();
// determine which template engine to use
示例11: configureSingleHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
*
* @return void
*/
protected function configureSingleHandler(Application $app, Writer $log)
{
$log->useFiles(storage_path('logs/laravel.log'));
}
示例12: configureSingleHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureSingleHandler(Application $app, Writer $log)
{
$fileName = php_sapi_name();
$log->useFiles($app->storagePath() . '/logs/' . $fileName . '.log');
}
示例13: configureSingleHandler
/**
* Configure the Monolog handlers for the application.
*
* @param \Illuminate\Log\Writer $log
* @return void
*/
protected function configureSingleHandler(Writer $log)
{
$log->useFiles($this->app->storagePath() . '/logs/laravel.log', $this->logLevel());
}