landsLog4j - Initilization Requirement - posted by Log4j issues message "Please initialize the log4j system properly". Log4j might want to request such initialization but it should nonetheless, perform a default init BasicConfigurator.configure (); and give the user the messages that he wanted to log without mandating.

Log4j - Documentation request - posted by

Getting started with the simplest log4j setup requires three lines of code:

Logger logger = Logger.getLogger( MyClass.class );
logger.debug( "your message here" );

There should be a quickstart page in the docs that says this. (Actually, I was quite annoyed at having to wade through the short manual and API docs to figure this out, when I was deciding whether or not I wanted to use log4j; I ranted about it on my blog here:

Log4j - Logging as RSS or Atom - posted by

Add a new appender that outputs RSS. This would support the aggregation of application events through existing RSS syndication and aggregation mechanisms A trivial variant could output Atom instead of RSS.

The concept of an XML Layout tool would seem a better way to approach this, but the current XMLLayout class uses a constrained XML vocabulary, so it can't be configured for general XML document production. So perhaps this should be realized by an RssLayout and AtomLayout class which would maintain the separation of concerns from the appender logic.

Log4J - AsyncAppender - posted by 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());

    LoggingEvent event;
>>  long lastCycle = 0L;

    while(true) {
      synchronized(bf) {
        if(bf.length() == 0) {
          // Exit loop if interrupted but only if the the buffer is empty.
          if(interrupted) {
          try {
            //LogLog.debug("Waiting for new event to dispatch.");
            // wait at least a given amount of time: waitMin. Interesting
            // if the appender are mail or messaging appenders
            // waitMin optional by configuration settings or 0
            // would be usefull to test if buffer is full before waiting more time
>>            if((System.currentTimeMillis() - lastCycle)/1000 < waitMin)
>>                bf.wait(waitMin*1000 -(System.currentTimeMillis()-lastCycle);
          } catch(InterruptedException e) {
            LogLog.error("The dispatcher should not be interrupted.");
...more lines
        if(aai != null && event != null) {
>>      lastCycle = System.currentTimeMillis();
    } // while

Log4J - Requested Features

LogFactor 5 - Requested Features

Log4jRequestedFeatures (last edited 2012-02-04 20:38:13 by cpc10-lewi14-2-0-cust355)