View Javadoc

1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2011, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.classic.spi;
15  
16  import java.util.Map;
17  
18  import org.slf4j.Marker;
19  
20  import ch.qos.logback.classic.Level;
21  import ch.qos.logback.core.spi.DeferredProcessingAware;
22  
23  /**
24   * The central interface in logback-classic. In a nutshell, logback-classic is
25   * nothing more than a processing chain built around this interface.
26   * 
27   * @author Ceki Gülcü
28   * @since 0.9.16
29   */
30  public interface ILoggingEvent extends DeferredProcessingAware {
31  
32    public String getThreadName();
33  
34    public Level getLevel();
35  
36    public String getMessage();
37  
38    public Object[] getArgumentArray();
39  
40    public String getFormattedMessage();
41  
42    public String getLoggerName();
43  
44    public LoggerContextVO getLoggerContextVO();
45  
46    public IThrowableProxy getThrowableProxy();
47  
48    /**
49     * Return caller data associated with this event. Note that calling this event
50     * may trigger the computation of caller data.
51     * 
52     * @return the caller data associated with this event.
53     * 
54     * @see #hasCallerData()
55     */
56    public StackTraceElement[] getCallerData();
57  
58    /**
59     * If this event has caller data, then true is returned. Otherwise the
60     * returned value is null.
61     * 
62     * <p>Logback components wishing to use caller data if available without
63     * causing it to be computed can invoke this method before invoking
64     * {@link #getCallerData()}.
65     * 
66     * @return whether this event has caller data
67     */
68    public boolean hasCallerData();
69  
70    public Marker getMarker();
71  
72    /**
73     * Returns the MDC map. The returned value can be an empty map but not null.
74     */
75    public Map<String, String> getMDCPropertyMap();
76  
77    /**
78     * Synonym for [@link #getMDCPropertyMap}.
79     * @deprecated  Replaced by [@link #getMDCPropertyMap}
80     */
81    public Map<String, String> getMdc();
82    public long getTimeStamp();
83  
84    public void prepareForDeferredProcessing();
85  
86  }