Ns logctl

From AOLserver Wiki
Jump to: navigation, search

Man page: http://aolserver.com/man/4.0/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

<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></pre>

SEE ALSO

ns_log