= Log4j wiki migrated to a [http://wiki.apache.org/logging-log4j/Log4JProjectPages new home]. This page is no longer updated! =


Log4J - AsyncAppender - posted by marc.oesch@gmx.net Additional/optional parameter which defines a time (in seconds) to pause after subsequent waves of logEvents are released to the Appenders (and if not yet available specifiy the size of the circular buffer). In combination with an SMTPAppender this avoids to have mail flooding. Events can be grouped in mail messages. In my opinion only very small changes need to be done to the AsyncAppender like for ex.: Run method in inner class Dispatcher

public void run() {

{{{ //Category cat = Category.getInstance(Dispatcher.class.getName());

>> long lastCycle = 0L;

    while(true) { 
      synchronized(bf) { 

{{{ // wait at least a given amount of time: waitMin. Interesting

>> if((System.currentTimeMillis() - lastCycle)/1000 < waitMin) >> bf.wait(waitMin*1000 -(System.currentTimeMillis()-lastCycle);

...more lines

      }  >> lastCycle = System.currentTimeMillis();     } // while 


Log4J - Requested Features


LogFactor 5 - Requested Features


Log4J - Requested Features

   static LogText lt = LogText.getLogText("com.example.app.MyApp"); 

Or

{{{ static LogText lt = LogText.getLogText(MyApp.class);

Example contents:

{{{ # MyApp.properties

Example usage:

{{{ String name = "George";

Example output:

{{{ Hello, George

Class signature:

{{{ public class LogText {

Benefits:

{{{ if (log.isDebugEnabled())

Can be written instead as     log.debug(lt.get("using", bar, foo)); 

Log4JProjectPages/Log4jRequestedFeatures (last edited 2009-09-20 23:32:23 by localhost)