Class JasConsoleAppender

  • All Implemented Interfaces:
    org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

    public class JasConsoleAppender
    extends org.apache.log4j.WriterAppender
    JAS custom log4j appender to catch logs and write them into the JAS Console window.

    If you want to enable logging on the JAS console simply add this appender to the log4j.properties file, like that:

    log4j.appender.stdout=microsim.gui.shell.JasConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

    Title: JAS

    Description: Java Agent-based Simulation library

    Copyright (C) 2002-13 Michele Sonnessa

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
    Author:
    Michele Sonnessa
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(org.apache.log4j.spi.LoggingEvent event)  
      • Methods inherited from class org.apache.log4j.WriterAppender

        activateOptions, close, getEncoding, getImmediateFlush, requiresLayout, setEncoding, setErrorHandler, setImmediateFlush, setWriter
      • Methods inherited from class org.apache.log4j.AppenderSkeleton

        addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setLayout, setName, setThreshold
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JasConsoleAppender

        public JasConsoleAppender()
      • JasConsoleAppender

        public JasConsoleAppender​(org.apache.log4j.Layout layout,
                                  java.io.OutputStream os)
      • JasConsoleAppender

        public JasConsoleAppender​(org.apache.log4j.Layout layout,
                                  java.io.Writer writer)
    • Method Detail

      • append

        public void append​(org.apache.log4j.spi.LoggingEvent event)
        Overrides:
        append in class org.apache.log4j.WriterAppender