[TYPO3-english] devlog on production system
Georg Schönweger
georg.schoenweger at gmail.com
Thu Mar 31 14:22:12 CEST 2011
Hello Francois,
thank you for your explanation. In class.t3lib_div.php i found:
* If you want to implement the devLog in your applications, simply
add lines like:
* if (TYPO3_DLOG) t3lib_div::devLog('[write message in english
here]', 'extension key');
So the proper way of implementing devLog in own extensions is to first
check if enable_DLOG is enabled. Also the problematic extension on our
website is writing to devlog only with enable_DLOG=1
I looked now at the source code of devlog extension. The checks if
devlog should write to database are made at the beginning of
class.tx_devlog.php . So if i have enabled enable_DLOG and set "Minimum
logging level" to 3 it would log not that much to DB.
For all other debug messages with log levels less than 3 it is just a
few IF conditions .. do you think this few if conditions can reduce the
performance? Are there so many calls to devLog() in Typo3 Core with
enable_DLOG=1?
- Georg
Am 31.03.2011 13:26, schrieb François Suter:
> Hi,
>
>> How do you manage logging on production systems? Is it a good idea to
>> activate it on a production system if "Minimun level for logging" is set
>> to 3 (only Errors)? Do i have to expect less performance?
>
> It really depends. There's a general setting in the Install Tool
> called enableDLOG. If you enable it, TYPO3 (and extensions respecting
> this flag) will start spitting a huge number of devlog entries. So
> with this setting, you have to be careful, it could indeed lower
> performance. And blow up your database if you don't set a limit on the
> amount of records to store in table tx_devlog. There are lost of ways
> you can reduce the number of entries, though. Minimum level is one,
> although sometimes you may want to see also informational messages and
> not just errors. You can set extension keys to ignore some source of
> messages (for example, RealURL is very verbose and if your problem is
> not related to RealURL, these log entries would be useless to you).
>
> Now besides that general setting, quite a few extensions have their
> own debug/devlog flag. In such a case you may just turn on logging for
> one extension and have a reduced number of log entries.
>
> And of course you may add devlog calls yourself inside the code you're
> trying to debug.
>
> Still if the calls are in a piece of code that's called very often,
> you could encounter performance problems. Maybe in such a case - if
> all the above-mentioned filtering is not enough - you could just turn
> logging on for a few minutes, hoping you catch the problematic event
> and turn it off again.
>
> HTH
>
More information about the TYPO3-english
mailing list