001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache license, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the license for the specific language governing permissions and
015 * limitations under the license.
016 */
017package org.apache.log4j.spi;
018
019import org.apache.log4j.Category;
020import org.apache.log4j.Level;
021import org.apache.log4j.bridge.LogEventAdapter;
022
023import java.util.Map;
024import java.util.Set;
025
026/**
027 *  No-op version of Log4j 1.2 LoggingEvent. This class is not directly used by Log4j 1.x clients but is used by
028 *  the Log4j 2 LogEvent adapter to be compatible with Log4j 1.x components.
029 */
030public class LoggingEvent {
031
032    /**
033     Set the location information for this logging event. The collected
034     information is cached for future use.
035     @return Always returns null.
036     */
037    public LocationInfo getLocationInformation() {
038        return null;
039    }
040
041    /**
042     * Return the level of this event. Use this form instead of directly
043     * accessing the <code>level</code> field.
044     * @return Always returns null.
045     */
046    public Level getLevel() {
047        return null;
048    }
049
050    /**
051     * Return the name of the logger. Use this form instead of directly
052     * accessing the <code>categoryName</code> field.
053     * @return Always returns null.
054     */
055    public String getLoggerName() {
056        return null;
057    }
058
059    public String getFQNOfLoggerClass() {
060        return null;
061    }
062
063    public long getTimeStamp() {
064        return 0;
065    }
066
067    /**
068     * Gets the logger of the event.
069     * Use should be restricted to cloning events.
070     * @return Always returns null.
071     * @since 1.2.15
072     */
073    public Category getLogger() {
074        return null;
075    }
076
077    /**
078     Return the message for this logging event.
079
080     <p>Before serialization, the returned object is the message
081     passed by the user to generate the logging event. After
082     serialization, the returned value equals the String form of the
083     message possibly after object rendering.
084     @return Always returns null.
085     @since 1.1 */
086    public
087    Object getMessage() {
088        return null;
089    }
090
091    public
092    String getNDC() {
093        return null;
094    }
095
096    public
097    Object getMDC(String key) {
098        return null;
099    }
100
101    /**
102     Obtain a copy of this thread's MDC prior to serialization or
103     asynchronous logging.
104     */
105    public void getMDCCopy() {
106    }
107
108    public String getRenderedMessage() {
109        return null;
110    }
111
112    /**
113     Returns the time when the application started, in milliseconds
114     elapsed since 01.01.1970.
115     @return the JVM start time.
116     */
117    public static long getStartTime() {
118        return LogEventAdapter.getStartTime();
119    }
120
121    public String getThreadName() {
122        return null;
123    }
124
125    /**
126     Returns the throwable information contained within this
127     event. May be <code>null</code> if there is no such information.
128
129     <p>Note that the {@link Throwable} object contained within a
130     {@link ThrowableInformation} does not survive serialization.
131     @return Always returns null.
132     @since 1.1 */
133    public ThrowableInformation getThrowableInformation() {
134        return null;
135    }
136
137    /**
138     Return this event's throwable's string[] representaion.
139     @return Always returns null.
140     */
141    public String[] getThrowableStrRep() {
142        return null;
143    }
144
145    public void setProperty(final String propName,
146            final String propValue) {
147
148    }
149
150    public String getProperty(final String key) {
151        return null;
152    }
153
154    public Set getPropertyKeySet() {
155        return null;
156    }
157
158    public Map getProperties() {
159        return null;
160    }
161
162    public Object removeProperty(String propName) {
163        return null;
164    }
165}