Log micropub requests to their own log file
This commit is contained in:
parent
3099314fe0
commit
d7e1165e7f
1 changed files with 5 additions and 2 deletions
|
@ -2,9 +2,10 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Log;
|
use Monolog\Logger;
|
||||||
use Ramsey\Uuid\Uuid;
|
use Ramsey\Uuid\Uuid;
|
||||||
use App\{Media, Note, Place};
|
use App\{Media, Note, Place};
|
||||||
|
use Monolog\Handler\StreamHandler;
|
||||||
use Illuminate\Http\{Request, Response};
|
use Illuminate\Http\{Request, Response};
|
||||||
use App\Exceptions\InvalidTokenException;
|
use App\Exceptions\InvalidTokenException;
|
||||||
use Phaza\LaravelPostgis\Geometries\Point;
|
use Phaza\LaravelPostgis\Geometries\Point;
|
||||||
|
@ -60,7 +61,9 @@ class MicropubController extends Controller
|
||||||
], 400);
|
], 400);
|
||||||
}
|
}
|
||||||
// Log the request
|
// Log the request
|
||||||
Log::debug($request);
|
$logger = new Logger('micropub');
|
||||||
|
$logger->pushHandler(new StreamHandler(storage_path('logs/micropub.log')), Logger::DEBUG);
|
||||||
|
$logger->debug('MicropubLog', $request->all());
|
||||||
if ($tokenData->hasClaim('scope')) {
|
if ($tokenData->hasClaim('scope')) {
|
||||||
if (($request->input('h') == 'entry') || ($request->input('type.0') == 'h-entry')) {
|
if (($request->input('h') == 'entry') || ($request->input('type.0') == 'h-entry')) {
|
||||||
if (stristr($tokenData->getClaim('scope'), 'create') === false) {
|
if (stristr($tokenData->getClaim('scope'), 'create') === false) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue