Log SQL Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MorningStar
    Junior Member
    • Feb 2018
    • 12

    Log SQL Query

    Is it posible to activate log for all sql queries?
  • Kurt
    Member
    • Jan 2018
    • 37

    #2
    I have the same question. I have seen suggestions elsewhere that say "set logger level in data/config.php to 'DEBUG'" but that does not work for me. It actually doesn't increase the logging at all which may be another issue.

    I tried adding print statements in a variety of places but haven't been able to find a place where it actually puts the query together (I'm not a PHP developer). In my situation I'm trying to override getDuplicateWhereClause() for a few entities but it's not following the logic as I would expect (it's counting the same entity as a duplicate even though Record.php seems to have code that should prevent that). So looking at the SQL it's putting together would be helpful in debugging...

    Comment

    • tanya
      Senior Member
      • Jun 2014
      • 4308

      #3
      EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

      add here $GLOBALS['log']->debug($sql); and save
      Last edited by tanya; 07-31-2019, 08:50 AM.

      Comment

      • khopper
        Senior Member
        • Sep 2017
        • 343

        #4
        Originally posted by tanya
        https://github.com/espocrm/espocrm/b.../Base.php#L431
        add here $GLOBALS['log']->debug($sql); and save
        Where would this be added to?

        Comment

        • yuri
          Member
          • Mar 2014
          • 8860

          #5
          It's already possible to log SQL queries to the log file. https://docs.espocrm.com/administrat...g/#sql-queries
          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

          Working...