Difference between revisions of "Ns logctl"
Jump to navigation
Jump to search
(imported from WiKit id 598) |
m (category link fixup, formatting tweaks) |
||
Line 1: | Line 1: | ||
− | + | <manpage>ns_logctl</manpage> | |
---- | ---- | ||
Line 40: | Line 40: | ||
'''EXAMPLES''' | '''EXAMPLES''' | ||
+ | <pre><nowiki> | ||
<% | <% | ||
ns_logctl hold | ns_logctl hold | ||
Line 47: | Line 48: | ||
<% | <% | ||
− | if { | + | if {[ns_logctl count] > 0} { |
− | ns_adp_puts "<hr><p>Page generated log messages:</p><pre> | + | ns_adp_puts "<hr><p>Page generated log messages:</p><pre>[ns_logctl peek]</pre> |
} | } | ||
ns_logctl release | ns_logctl release | ||
%> | %> | ||
+ | </nowiki></pre> | ||
'''SEE ALSO''' | '''SEE ALSO''' | ||
Line 57: | Line 59: | ||
: [[ns_log]] | : [[ns_log]] | ||
− | + | [[Category:Core Tcl API]] | |
− | |||
− |
Latest revision as of 19:31, 19 October 2005
<manpage>ns_logctl</manpage>
NAME
- ns_logctl - Control buffering of log messages
SYNOPSIS
- ns_logctl option ?arg arg ...?
DESCRIPTION
- This command provides control over the buffering of log messages generated by a thread instead of sending them directly to the log file. This allows functionality like displaying log messages at the end of an ADP page, for example.
- The legal options are:
- ns_logctl hold
- Turn buffering of log messages on. Log messages are no longer written directly to the server log.
- ns_logctl count
- Returns a count of the buffered log messages.
- ns_logctl peek
- Returns the buffered log messages without affecting the cache.
- ns_logctl get
- Returns the buffered log messages and removes them from the buffer without writing them to the log.
- ns_logctl flush
- Write the buffered log messages.
- ns_logctl release
- Write the buffered log messages and turn buffering off.
- ns_logctl truncate len
- Truncate the buffer at length len.
EXAMPLES
<nowiki> <% ns_logctl hold ... do some stuff here ... %> <% if {[ns_logctl count] > 0} { ns_adp_puts "<hr><p>Page generated log messages:</p><pre>[ns_logctl peek]
} ns_logctl release %>
</nowiki>
SEE ALSO