dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Move SQL logging to database handler


From: Florian Henry
Subject: Re: [Dolibarr-dev] Move SQL logging to database handler
Date: Wed, 16 Jul 2014 15:52:20 +0200

Nice shot !

Envoyer depuis mon mobile.


Marcos García <address@hidden> a écrit :

The PR got accepted so, remember from now on to not log SQL errors and/or queries unless you explicitly need it (they will be logged by the DB handler).

Regards,
 
Marcos García
address@hidden


2014-06-10 15:16 GMT+02:00 Doursenaud, Raphaël <address@hidden>:
Well not really. Putting the query logger into the SQL class does not prevent you from calling the logger in your own code (for comments, special cases…). It will just display on the line before the query. Best of both worlds.

If you really want to know what part of the code trigger the sql query, we can still extand the logger call to include debug_backtrace() informations like the caller class name.

But if you're down to needing such low level informations, you should start using a debugger right now ;) Xdebug FTW!


2014-06-10 15:09 GMT+02:00 Florian HENRY <address@hidden>:

Hi,

    I think it is a good idea, but the avantage of logging inside code is to speficy special remark into log file
    dol_syslog(get_class($this).'/'.pathinfo(__FILE__,PATHINFO_FILENAME).'::'.__FUNCTION__.' HereIPutTextThatICanFindInLogEasy sql='.$sql);

    Avantage to put it into SQL handler : all SQL query will be logged that is very good things.
    Disavantage,  we do not know anymore what file/code part launch the request.

Regards
Florian Henry
+33 6 03 76 48 07
address@hidden
http://www.open-concept.pro
Twitter : @_Open_Concept_
Le 10/06/2014 13:59, Marcos García a écrit :
Hi all:

I found many dol_syslog calls from all over the code logging SQL to the syslog module, so I found more appropiate to move them to the database handler query function and decrease logging level to DEBUG (https://github.com/Dolibarr/dolibarr/pull/1647/files).

The thing is that Francis Appels (https://github.com/fappels) warned me that there are many more dol_syslog calls with format "class/file::function sql=".$sql which are around of 800 calls.

I propose to change "class/file::function sql=".$sql to "class/file::function". Because I find more appropiate to log SQL from the SQL handler and no from all over the code.

Before going into that, what do you think about it?

Regards,
 
Marcos García
address@hidden


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev


_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev




Technopole Hélioparc
2 avenue du Président Pierre Angot
64053 PAU CEDEX 9
SARL GPC.solutions au capital de 7 500 € - R.C.S. PAU 528 995 921

_______________________________________________
Dolibarr-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/dolibarr-dev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]