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 Appe
Factoring code is always a good idea, you have my vote !
2014-06-10 13:59 GMT+02:00 Marcos García :
> 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
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
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,