[ Table Of Contents | Keyword Index ]

ns_logctl(n) 4.99 "NaviServer Built-in Commands"

NAME

ns_logctl - Control buffering of log messages

TABLE OF CONTENTS

    TABLE OF CONTENTS
    SYNOPSIS
    DESCRIPTION
    COMMANDS
    EXAMPLES
    SEE ALSO
    KEYWORDS

SYNOPSIS

ns_logctl option ?arg arg ...?
ns_logctl hold
ns_logctl count
ns_logctl peek
ns_logctl get
ns_logctl flush
ns_logctl release
ns_logctl truncate len

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.

COMMANDS

ns_logctl option ?arg arg ...?
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 "<hr>Page generated log messages:</p><pre>[ns_logctl peek]</pre>"
      }
      ns_logctl release
    %>;

SEE ALSO

nsd

KEYWORDS

ns_log