Start page

Mykola Zharkikh (Kyiv)

Personal site



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 0.022517
SmerecashPage 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 / 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.