M.Zharkikh's personal site logo
Mail to site
Print version
News (RSS)
Smereka / For programmers / Logs


For programmers


Smereka may protocolize its work in four log files. All they are written in a logs subdirectory of the Smereka software directory Smereka.

Log file debuglog.txt is intended for program debugging. To use it, one should set variable $DebugMode = 1 in the customsettings.php module and then put line < span class="Program">DebugLog('Some text') in the right place.

After debugging, one should remove or comment all these lines and set $DebugMode = 0. This log is intended mainly for Smereka programmers.

Log file errorlog.txt is intended to track internal Smereka errors. This log should not be confused with web server error log. Smereka writes in this log messages on its own critical error, such as lack of necessary metaobject or detect cyclic references in the tree.

So if Smereka works wrong, the first thing that the administrator has to check is this error log.

Log file sqllog.txt is intended to trace database requests. Tracing mode is specified by $SQLLogLevel variable in customsettings.php module. If this variable is zero, tracing is not performed (recommended mode).

If this variable = 1, SQL operators INSERT, UPDATE, DELETE is written in this log.

If this variable = 2, also SQL operators SELECT is written in this log.

This log is intended mainly for programmers when debugging programs. In regular operation mode this tracing should be disabled for speed.

Log file timerlog.txt is intended for profiling spending time in Smereka. Profiling mode is set by $TimerLogLevel variable in customsettings.php module. If this variable is zero, profiling is not performed (recommended mode).

If this variable = 1, for each incoming request one line is written in the log, that contains the exit point and time (in seconds) spent on Smereka achieve this point. For example:

Main 1054 0.134212
SmerecashPage www.m-zharkikh.name/uk/News.html 0.022517
SmerecashPage www.m-zharkikh.name/uk/ColloidSci.html 0.043600
Main 1057 0.133644
Main 1109 0.244285
Main:: CommandRedirect 1109 1.294339
Main 1110 0.730506
Main 1110 0.150956
DisplayErrPage 404 / www.m-zharkikh.name/sitemap.xml 0.073219

This mode is intended for general program performance evaluation.

If this variable = 2, main stages of request processing are logges, ending with record at exit point. In this mode, one can trace where Smereka spends the most time, and then plan the code optimization.

If this variable = 3, the most detailed trace performed. This mode can also be used to optimize code or to find errors. If the problem is so serious, that prevent Smereka to display error page, the last entry in the log provides a bookmark in which the snippet of code failed. The hardest errors for Smereka are syntax errors in the modules that connected through the metaobjects.

Previous section | Table of content | Next section

Please this page? Help us to develop this site!

1978 2018 N.I.Zharkikh

Reprinting of articles from site are encouraged while
reference (hyperlink) to my site is provided

Site powered by

Load count : 1111

Modified : 8.08.2017

If you look up the type error
on this page, please select it
by mouse and press Ctrl+Enter.