sunlabs.brazil.sunlabs
Class LogTemplate

java.lang.Object
  extended by sunlabs.brazil.template.Template
      extended by sunlabs.brazil.sunlabs.LogTemplate (view source)
All Implemented Interfaces:
TemplateInterface

public class LogTemplate
extends Template

Template for logging to files. This is a skeleton for now, to be fleshed out as required. It dumps an arbitrary string to a log file. It is intended primarily for debugging.

 <log message="text message" [file="file name" flush=n close=true]>
 
Appends to the named log file, creating the file if it doesn't already exist.

Attributes:

message
The message to log. a newline is added
filename
The name of the file to log to. File names are relative to the Current directory (not the document root). Defaults to the template prefix with a "log" as the suffix.
flush
How many lines to buffer before flushing the output to disk. The default is "1".
close=true
Close a logger and free up any resources associated with it.
Notes:
Creating too many loggers will run the system out of file descriptors. Loggers are shared accross all sessions.


Nested Class Summary
static class LogTemplate.Logger
           
 
Field Summary
 
Fields inherited from class sunlabs.brazil.template.Template
debug
 
Constructor Summary
LogTemplate()
           
 
Method Summary
 void tag_log(RewriteContext hr)
           
 
Methods inherited from class sunlabs.brazil.template.Template
done, init
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogTemplate

public LogTemplate()
Method Detail

tag_log

public void tag_log(RewriteContext hr)

Version Kenai-svn-r24, Generated 08/18/09
Copyright (c) 2001-2009, Sun Microsystems.