com.grandcentral.appstats.reporters
Class TaskLogger

java.lang.Object
  |
  +--com.grandcentral.appstats.reporters.TaskLogger
All Implemented Interfaces:
FlushListener

public class TaskLogger
extends java.lang.Object
implements FlushListener

creates a log entry of all Stats every time a task is flushed. Uses log4j info level logging for root category (default) or whatever Category you pass into this object. This implementation is not thread safe, so do not share one instance across multiple Tasks.


Field Summary
static java.lang.String LOG4J_PATTERNLAYOUT_CONVERSIONPATTERN
           
 
Constructor Summary
TaskLogger()
           
TaskLogger(org.apache.log4j.Category c)
           
 
Method Summary
 org.apache.log4j.Category getCategory()
           
 void setCategory(org.apache.log4j.Category c)
           
 void setLogErrors(boolean b)
          instruct this logger whether to log errors to Category.error stream or not (default==true)
 void taskFlushed(Task t)
          this handler is invoked when t.flush() is called, before the Task has been aggregated to its parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_PATTERNLAYOUT_CONVERSIONPATTERN

public static final java.lang.String LOG4J_PATTERNLAYOUT_CONVERSIONPATTERN
Constructor Detail

TaskLogger

public TaskLogger()

TaskLogger

public TaskLogger(org.apache.log4j.Category c)
Method Detail

setCategory

public void setCategory(org.apache.log4j.Category c)

getCategory

public org.apache.log4j.Category getCategory()

setLogErrors

public void setLogErrors(boolean b)
instruct this logger whether to log errors to Category.error stream or not (default==true)

taskFlushed

public void taskFlushed(Task t)
Description copied from interface: FlushListener
this handler is invoked when t.flush() is called, before the Task has been aggregated to its parent. Please don't call t.flush() inside this method, for your own sake.
Specified by:
taskFlushed in interface FlushListener