The Slim Framework support forum has moved to http://discourse.slimframework.com. This Tender forum is no longer maintained or monitored.

How to save all Request, Response and Errors in mysql database table with log.

manjeet's Avatar

manjeet

29 Jun, 2015 12:20 PM

Hello,
Anyone can tell me that how can i save my all loges including Request, Response and PHP Errors in mysql database table ?
If anyone know then reply !

Thanks,
Mac

  1. 1 Posted by manjeet on 30 Jun, 2015 07:27 AM

    manjeet's Avatar

    ANY ONE HAVE ANY ANSWER????????????????????????/

  2. 2 Posted by Chris on 29 Dec, 2015 10:05 AM

    Chris's Avatar

    I have the same question...

  3. 3 Posted by geggleto on 29 Dec, 2015 04:46 PM

    geggleto's Avatar

    You can write a middleware.

    $app->add(function ($req, $res, $next) {

        $res = $next($req, $res);

        //Do your logging things here

        return $res;

    });

  4. 4 Posted by Christopher Ple... on 30 Dec, 2015 03:03 PM

    Christopher Pleines's Avatar

    Middlewares will work to log requests coming in,
    but I cannot log responses before sending them out.
    In v2 there was a possibility to hook in before sending a response but it has been removed

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac