Ns logctl

From AOLserver Wiki
Revision as of 13:24, 15 June 2004 by WikiSysop (talk | contribs) (imported from WiKit id 598)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Man page: http://aolserver.com/docs/tcl/ns_logctl.html


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

   <%
     ns_logctl hold
     ... do some stuff here ...
   %>
   <%
     if {ns_logctl count > 0} {

ns_adp_puts "


Page generated log messages:

[[ns_logctl peek]]
     }
     ns_logctl release
   %>

SEE ALSO

ns_log

Category Documentation - Category Core Tcl API