$body = @file_get_contents( 'php://input' );
$log = __DIR__ . '/data.log';
try {
$body = json_decode( $body, true, 512, JSON_THROW_ON_ERROR );
file_put_contents( $log, print_r( $body, true ), FILE_APPEND );
} catch ( JsonException $e ) {
file_put_contents( $log, $e->getMessage(), FILE_APPEND );
}
tail -f data.log