Not sure, where the problem is.
If these commands are e.g. entered via ds/shell, the output will show up immediately in the error log, containing all substituted variables, no server restart required. This intensive loggin can be as well the same way turned off.
One can also colorize the output (see e.g. the sample config file openacs-config.tcl as provided from the NaviServer repository.
Is this, what you are after, or is there some other problem?
-g
[13/Aug/2017:11:59:39][29767.7f56cf12b700][-conn:openacs.org:59:583655-] Debug(sql): pool pool1 duration 0.002378 secs: '
select message_id,
0 as n_attachments,
t.subject,
t.content,
t.format,
person__name(t.user_id) as user_name,
to_char(t.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi,
tree_level(t.tree_sortkey) as tree_level,
t.state,
t.user_id,
t.parent_id,
t.open_p,
t.max_child_sortkey,
u.screen_name
from forums_messages_approved t, users u
where t.forum_id = '14013'
and u.user_id = t.user_id
and t.tree_sortkey between tree_left('10000000000000000000110100001100') and tree_right('10000000000000000000110100001100')
order by t.posting_date, tree_sortkey
.xql query:
select message_id,
0 as n_attachments,
t.subject,
t.content,
t.format,
person__name(t.user_id) as user_name,
to_char(t.posting_date, 'YYYY-MM-DD HH24:MI:SS') as posting_date_ansi,
tree_level(t.tree_sortkey) as tree_level,
t.state,
t.user_id,
t.parent_id,
t.open_p,
t.max_child_sortkey,
u.screen_name
from $table_name t, users u
where t.forum_id = :forum_id
and u.user_id = t.user_id
and t.tree_sortkey between tree_left(:tree_sortkey) and tree_right(:tree_sortkey)
order by $order_by