title: How do I create a new log4j ConsoleAppender in code as opposed to config?
body: <p>I want to programmatically create a new log4j ConsoleAppender and add it as an appender to a logger - how do I go about instantiating one properly - using the following seems to make log4j complain - what setters do I need to use to configure it properly?</p>
  
  <pre><code>// log4j complains of "No output stream or file set for the appender named [null]."
  logger.addAppender(new ConsoleAppender());
  </code></pre>
  
  <p>Presumably its a case of knowing what to set on the ConsoleAppender but I can't figure it out.  I assume there's some way of getting the default layout.  I just want a standard ConsoleAppender that appends to SysOut. Any guidance appreciated, thanks.</p>