001/**
002 * Logback: the reliable, generic, fast and flexible logging framework.
003 * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
004 *
005 * This program and the accompanying materials are dual-licensed under
006 * either the terms of the Eclipse Public License v1.0 as published by
007 * the Eclipse Foundation
008 *
009 *   or (per the licensee's choosing)
010 *
011 * under the terms of the GNU Lesser General Public License version 2.1
012 * as published by the Free Software Foundation.
013 */
014package ch.qos.logback.classic.spi;
015
016import java.util.Map;
017
018import org.slf4j.Marker;
019
020import ch.qos.logback.classic.Level;
021import ch.qos.logback.core.spi.DeferredProcessingAware;
022
023/**
024 * The central interface in logback-classic. In a nutshell, logback-classic is
025 * nothing more than a processing chain built around this interface.
026 * 
027 * @author Ceki Gülcü
028 * @since 0.9.16
029 */
030public interface ILoggingEvent extends DeferredProcessingAware {
031
032    String getThreadName();
033
034    Level getLevel();
035
036    String getMessage();
037
038    Object[] getArgumentArray();
039
040    String getFormattedMessage();
041
042    String getLoggerName();
043
044    LoggerContextVO getLoggerContextVO();
045
046    IThrowableProxy getThrowableProxy();
047
048    /**
049     * Return caller data associated with this event. Note that calling this event
050     * may trigger the computation of caller data.
051     * 
052     * @return the caller data associated with this event.
053     * 
054     * @see #hasCallerData()
055     */
056    StackTraceElement[] getCallerData();
057
058    /**
059     * If this event has caller data, then true is returned. Otherwise the
060     * returned value is null.
061     * 
062     * <p>Logback components wishing to use caller data if available without
063     * causing it to be computed can invoke this method before invoking
064     * {@link #getCallerData()}.
065     * 
066     * @return whether this event has caller data
067     */
068    boolean hasCallerData();
069
070    Marker getMarker();
071
072    /**
073     * Returns the MDC map. The returned value can be an empty map but not null.
074     */
075    Map<String, String> getMDCPropertyMap();
076
077    /**
078     * Synonym for [@link #getMDCPropertyMap}.
079     * @deprecated  Replaced by [@link #getMDCPropertyMap}
080     */
081    Map<String, String> getMdc();
082
083    long getTimeStamp();
084    
085    /**
086     * The sequence number associated with this event. 
087     * 
088     * <p>Sequence numbers, if present, should be increasing monotonically.
089     *  
090     * @since 1.3.0
091     */
092    long getSequenceNumber();
093
094    void prepareForDeferredProcessing();
095
096}