Log Config.php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziondevil
    Member
    • Jun 2016
    • 30

    Log Config.php

    Hi,

    I'm changed the config file to display all errors in the log file but nothing hapens.

    Here is my config file

    ],
    'language' => 'pt_BR',
    'logger' => [
    'path' => 'data/logs/crm.log',
    'level' => 'ALL',
    'rotation' => false,
    'maxFileNumber' => 30


    Any hint?
  • yuri
    Member
    • Mar 2014
    • 8440

    #2
    We're a group of established PHP projects whose goal is to talk about commonalities between our projects and find ways we can work better together.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • ziondevil
      Member
      • Jun 2016
      • 30

      #3
      already changed to DEBUG and nothing happens

      Comment

      • bandtank
        Active Community Member
        • Mar 2017
        • 379

        #4
        ziondevil, did you ever figure this out? I'm looking for a way to write log statements to the log and nothing I've tried has worked. I see a LoggerTrait in the vendor directory, but it doesn't seem to always work. It's really frustrating to not be able to log any output.

        Edit: I found a statement that works most of the time.

        $GLOBALS['log']->error();



        error takes three arguments and it dumps them to the log. Here's an example:

        $GLOBALS['log']->error('Job CheckInboundEmails '.$entity->id.': [' . $e->getCode() . '] ' .$e->getMessage());



        Most of the magic happens in here:

        application/Espo/Core/Utils/Api/Slim.php
        Last edited by bandtank; 03-06-2017, 04:52 AM.

        Comment

        • Kurt
          Member
          • Jan 2018
          • 37

          #5
          I'm having the same issue. Setting to 'DEBUG' does not work. I also found the $GLOBALS['log']->error() function as a backup but that's not practical to be sprinkling around. Has anyone figured out how to get DEBUG logging to work?

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Hi,
            I use DEBUG mode
            Code:
                'logger' => [
                    'path' => 'data/logs/espo.log',
                    'level' => 'DEBUG',
                    'rotation' => true,
                    'maxFileNumber' => 30
                ],
            Today's log records after rebuild
            Code:
            [2018-03-20 08:34:08] Espo.DEBUG: Schema\Converter - Start: building schema [] []
            [2018-03-20 08:34:08] Espo.DEBUG: DBAL: Table [entity_team] exists. [] []
            [2018-03-20 08:34:08] Espo.DEBUG: Schema\Converter - End: building schema [] []
            It works. Run rebuild and check the log file

            Comment

            Working...