1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache license, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the license for the specific language governing permissions and 15 * limitations under the license. 16 */ 17 package org.apache.log4j.spi; 18 19 import org.apache.log4j.Category; 20 import org.apache.log4j.Level; 21 import org.apache.log4j.bridge.LogEventAdapter; 22 23 import java.util.Map; 24 import java.util.Set; 25 26 /** 27 * No-op version of Log4j 1.2 LoggingEvent. This class is not directly used by Log4j 1.x clients but is used by 28 * the Log4j 2 LogEvent adapter to be compatible with Log4j 1.x components. 29 */ 30 public class LoggingEvent { 31 32 /** 33 Set the location information for this logging event. The collected 34 information is cached for future use. 35 @return Always returns null. 36 */ 37 public LocationInfo getLocationInformation() { 38 return null; 39 } 40 41 /** 42 * Return the level of this event. Use this form instead of directly 43 * accessing the <code>level</code> field. 44 * @return Always returns null. 45 */ 46 public Level getLevel() { 47 return null; 48 } 49 50 /** 51 * Return the name of the logger. Use this form instead of directly 52 * accessing the <code>categoryName</code> field. 53 * @return Always returns null. 54 */ 55 public String getLoggerName() { 56 return null; 57 } 58 59 public String getFQNOfLoggerClass() { 60 return null; 61 } 62 63 public long getTimeStamp() { 64 return 0; 65 } 66 67 /** 68 * Gets the logger of the event. 69 * Use should be restricted to cloning events. 70 * @return Always returns null. 71 * @since 1.2.15 72 */ 73 public Category getLogger() { 74 return null; 75 } 76 77 /** 78 Return the message for this logging event. 79 80 <p>Before serialization, the returned object is the message 81 passed by the user to generate the logging event. After 82 serialization, the returned value equals the String form of the 83 message possibly after object rendering. 84 @return Always returns null. 85 @since 1.1 */ 86 public 87 Object getMessage() { 88 return null; 89 } 90 91 public 92 String getNDC() { 93 return null; 94 } 95 96 public 97 Object getMDC(String key) { 98 return null; 99 } 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 }