Exemplo n.º 1
0
 public function useFiles($path, $level = 'debug')
 {
     if (Config::get('app.sae')) {
         return $this->useSaeLog($level);
     }
     parent::useFiles($path, $level);
 }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 3
0
 /**
  * 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);
 }
Exemplo n.º 4
0
 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';
 }
Exemplo n.º 5
0
 /**
  * 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);
 }
Exemplo n.º 6
0
 /**
  * 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');
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot(Writer $logger)
 {
     $logger->useFiles('php://stdout');
 }
 /**
  * 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');
 }
Exemplo n.º 9
0
 /**
  * @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'));
 }
Exemplo n.º 10
0
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
Exemplo n.º 11
0
 /**
  * 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'));
 }
Exemplo n.º 12
0
 /**
  * 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');
 }
Exemplo n.º 13
0
 /**
  * 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());
 }