How to log every response in laravel 5.2 framework
<p>I was using below code for logging each and every request and response for my API but now it's not working for Laravel 5.2. </p>

<p>I have tried to use <a href="https://laravel.com/docs/5.2/middleware#terminable-middleware" rel="nofollow">https://laravel.com/docs/5.2/middleware#terminable-middleware</a> but not succeed.  </p>

<pre><code>use Closure;  
use Illuminate\Contracts\Routing\TerminableMiddleware;  
use Illuminate\Support\Facades\Log;

class LogAfterRequest implements TerminableMiddleware {

    public function handle($request, Closure $next)
    {
        return $next($request);
    }

    public function terminate($request, $response)
    {
        $logFile = 'log.txt';
        Log::useDailyFiles(storage_path().'/logs/'.$logFile);
        Log::info('app.requests', ['request' =&gt; $request-&gt;all(), 'response' =&gt; $response-&gt;getContent()]);
    }

}
</code></pre>

<p>Can anyone suggest me the solution?</p>