Stuff
This commit is contained in:
parent
510bca3666
commit
faaff3b6d3
3 changed files with 60 additions and 0 deletions
|
@ -39,6 +39,13 @@ class PublicController extends BaseController
|
|||
}
|
||||
|
||||
public function returnImageFile($tenant, $gallery, $image, Request $request) {
|
||||
$image = Image::query()->where("id", "=", $image)->firstOrFail();
|
||||
$size = $request->input("size", "medium");
|
||||
$file = Storage::disk($image->driver)->response($image->path);
|
||||
return $file;
|
||||
}
|
||||
|
||||
public function returnImageFile2($tenant, $gallery, $image, Request $request) {
|
||||
$uid = uniqid();
|
||||
Log::info($uid.": Start", [$image]);
|
||||
$globalstart = microtime(true);
|
||||
|
|
27
app/Http/Middleware/LogMiddleware.php
Normal file
27
app/Http/Middleware/LogMiddleware.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\Tenant;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class TenanMiddleware
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
|
||||
Log::info("Request Start", ["time" => microtime(true)]);
|
||||
$r = $next($request);
|
||||
Log::info("Request end", ["time" => microtime(true)]);
|
||||
return $r;
|
||||
}
|
||||
}
|
26
app/Log.php
Normal file
26
app/Log.php
Normal file
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
namespace App;
|
||||
use Monolog\Processor\UidProcessor;
|
||||
|
||||
class Log
|
||||
{
|
||||
public function __invoke(Logger $logger)
|
||||
{
|
||||
/** @var Logger|\Monolog\Logger $logger */
|
||||
/** @var StreamHandler[] $handlers */
|
||||
$handlers = $logger->getHandlers();
|
||||
foreach ($handlers as $handler) {
|
||||
/*$handler->setFormatter(new LogstashFormatter('log', basename($handler->getUrl())));
|
||||
$handler->pushProcessor(new FieldsProcessor());
|
||||
$handler->pushProcessor(new WebProcessor());
|
||||
$handler->pushProcessor(new IntrospectionProcessor());
|
||||
$handler->pushProcessor(new GuardProcessor());
|
||||
$handler->pushProcessor(new QueryBindingsProcessor());
|
||||
$handler->pushProcessor(new HeadersProcessor());
|
||||
$handler->pushProcessor(new BadResponseGuzzleProcessor());
|
||||
|
||||
*/
|
||||
$handler->pushProcessor(new UidProcessor());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue