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

Logging config

radbasa's Avatar

radbasa

10 May, 2013 09:53 AM

I encountered some unexpected behavior while implementing Slim/Extras (>=2.0.3).

Slim/Extras documentation to configure logging as so:

$app->configureMode( 'development', function () use ( $app ) { 
    $app->config( array( 
        'debug' => true,
        'log.enabled' => true,
        'log.level' => \Slim\Log::ERROR,
        'log.writer' => new \Slim\Extras\Log\DateTimeFileWriter( array( 'path' => '../logs',
                                                                        'name_format' => 'Y-m-d' ) )
) ); } );

I tried this but Slim kept using the default log writer. It was sending log info to STDERR (Apache error log).

I looked around the forums and tried the following, which worked:

$app->configureMode( 'development', function () use ( $app ) { 
    $app->config( array( 
        'debug' => true,
    ) );
    $log = $app->getLog();
    $log->setEnabled( true );
    $log->setLevel( \Slim\Log::DEBUG );
    $log->setWriter( new \Slim\Extras\Log\DateTimeFileWriter( array( 'path' => '../logs',
                                                                        'name_format' => 'Y-m-d',
                                                                        'message_format' => '%label% - %date% - %message%' ) ) );
} );
  1. Support Staff 1 Posted by Andrew Smith on 01 Jun, 2013 03:54 PM

    Andrew Smith's Avatar

    Maybe this is a issue that has been fixed since that version of Slim, the latest stable version is 2.2.0.

  2. Support Staff 2 Posted by Brian Nesbitt on 02 Jun, 2013 02:44 AM

    Brian Nesbitt's Avatar

    Where is that documentation because it would be wrong. The slim docs show the methods for configuring logging during Slim app instantiation and after ... like this:

    <?php
    // During instantiation
    $app = new \Slim\Slim(array(
        'log.level' => \Slim\Log::DEBUG
    ));
    
    // After instantiation
    $log = $app->getLog();
    $log->setLevel(\Slim\Log::WARN);
    

    Setting a log config via the $app->config() doesn't work.

  3. 3 Posted by dev on 29 Mar, 2016 05:23 AM

    dev's Avatar

    good Their mother explained to depart but he explained as he'd something special for them they'll abandon 24 hours later. http://ishqkarangsafedtv.com/ishq-ka-rang-safed-title-song-colors-tv-serial/ Dhashrath asked her to relax. She questioned him to burn her in holi to be able to separate them. great.

  4. 4 Posted by raja on 05 Apr, 2016 07:45 AM

    raja's Avatar

    good I’ve previously distributed a content which can be how to download and mount https://mobdro-download.com You can decide on hundreds of televisions displays and videos. In addition, great.

  5. 5 Posted by jamessandoeval on 11 Jun, 2016 12:15 PM

    jamessandoeval's Avatar

    good but do need jailbreaking, today's your blessed evening. http://kodiforiphone.com We stated no, but we may believe it would make a difference. great.

  6. 6 Posted by joy on 12 Jun, 2016 10:12 AM

    joy's Avatar

    good equipment at excessive acceleration with support of Shareit. https://ishareitforpc.com/download-shareit-for-pc-windows-mac/ Smartphone to Smartphone, or laptop or computer nice.

  7. 7 Posted by ciyedefe on 27 Aug, 2016 01:57 PM

    ciyedefe's Avatar

    Copy the script from the site.
    http://heryogasecretsexposed.com/

  8. 8 Posted by timudiro on 31 Aug, 2016 01:09 AM

    timudiro's Avatar

    I don't know why you are showing unexpected behavior.
    http://theforwardheadposturefixpdf.com/

  9. 9 Posted by maes on 04 Oct, 2016 08:18 AM

    maes's Avatar
  10. 10 Posted by Umairali on 04 Oct, 2016 08:36 AM

    Umairali's Avatar

    Coding of Logging config of PHP mentioned in this page. Infect, Solution of some problems which people face while doing this task here. So, Author of this article have good experience and knowledge of Wordpress or Php development language. http://masterpapers.net/write-my-college-research-paper/

  11. 11 Posted by lewismichael230... on 25 Nov, 2016 09:45 AM

    lewismichael2301's Avatar

    awesome you may go through ShowBox is usually officially not available for https://ishowboxdownloadapp.com/showbox-for-pc-download-windows-10-8-7-xp-mac Bluesstacks many of these as Youwave, Andyroid and great.

  12. 12 Posted by worukuru on 07 Dec, 2016 07:57 AM

    worukuru's Avatar

    You will learn these codes to help other people.
    http://www.reviewshut.com/heartburn-no-more-review/

  13. 13 Posted by firufaci on 08 Dec, 2016 07:42 AM

    firufaci's Avatar

    Your behavior with your parents is very bad.
    http://crazybulkonlinereviews.com/

  14. 14 Posted by towikidi on 19 Dec, 2016 11:04 AM

    towikidi's Avatar

    We have to first complete our documentation.
    http://www.reviewprotocol.com/language-of-desire/

  15. 15 Posted by kunoqewu on 21 Dec, 2016 11:30 AM

    kunoqewu's Avatar
  16. 16 Posted by mattierhudson45... on 28 Dec, 2016 06:35 AM

    mattierhudson45kn's Avatar

    good and 9App that makes it the very best alternative application. https://9apps.meta.watch Countless android apps to choose from, 9 Apps provides nice.

  17. 17 Posted by Mehul on 31 Jan, 2017 11:55 AM

    Mehul's Avatar

    Great For Instagram customers Artisto is the cost-free https://artistoappdownload.com Application that makes this App a much loved App amongst all Fine.

  18. 18 Posted by sid on 19 Feb, 2017 06:35 AM

    sid's Avatar

    good COMPUTER mounted on blue pile gamer. https://mobdrodownloadapp.org all the smartdevice individuals that always prefer ncie.

  19. 19 Posted by raees on 22 Apr, 2017 06:10 AM

    raees's Avatar

    Include Kodi as an App Display Name. Click Start. https://kodidownloadtv.com We're greatly indebted in this situation to a forum customer.

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