/** * This removes the specified MDC property from the event. * Access to the MDC is not synchronized, so this * method should only be called when it is known that * no other threads are accessing the MDC. * @param propName the property name to remove * @since 1.2.16 */ public Object removeProperty(String propName) { if (mdcCopy == null) { getMDCCopy(); } if (mdcCopy == null) { mdcCopy = new Hashtable(); } return mdcCopy.remove(propName); } }
/** * Set value for MDC property. * This adds the specified MDC property to the event. * Access to the MDC is not synchronized, so this * method should only be called when it is known that * no other threads are accessing the MDC. * @since 1.2.15 * @param propName * @param propValue */ public final void setProperty(final String propName, final String propValue) { if (mdcCopy == null) { getMDCCopy(); } if (mdcCopy == null) { mdcCopy = new Hashtable(); } mdcCopy.put(propName, propValue); }
/** * Returns the set of properties * for the event. * * The returned set is unmodifiable by the caller. * * Provided for compatibility with log4j 1.3 * * @return Set an unmodifiable map of the properties. * @since 1.2.15 */ public Map getProperties() { getMDCCopy(); Map properties; if (mdcCopy == null) { properties = new HashMap(); } else { properties = mdcCopy; } return Collections.unmodifiableMap(properties); }
/** * Adds the event to the buffer. When full the buffer is flushed. */ public void append(LoggingEvent event) { event.getNDC(); event.getThreadName(); // Get a copy of this thread's MDC. event.getMDCCopy(); if (locationInfo) { event.getLocationInformation(); } event.getRenderedMessage(); event.getThrowableStrRep(); buffer.add(event); if (buffer.size() >= bufferSize) flushBuffer(); }
private void writeObject(ObjectOutputStream oos) throws java.io.IOException { // Aside from returning the current thread name the wgetThreadName // method sets the threadName variable. this.getThreadName(); // This sets the renders the message in case it wasn't up to now. this.getRenderedMessage(); // This call has a side effect of setting this.ndc and // setting ndcLookupRequired to false if not already false. this.getNDC(); // This call has a side effect of setting this.mdcCopy and // setting mdcLookupRequired to false if not already false. this.getMDCCopy(); // This sets the throwable sting representation of the event throwable. this.getThrowableStrRep(); oos.defaultWriteObject(); // serialize this event's level writeLevel(oos); }
event.getThreadName(); event.getMDCCopy(); if (locationInfo) { event.getLocationInformation();
event.getMDCCopy(); event.getRenderedMessage(); event.getThrowableStrRep();
event.getMDCCopy(); event.getRenderedMessage(); event.getThrowableStrRep();
/** Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. */ public void append(LoggingEvent event) { if(!checkEntryConditions()) { return; } event.getThreadName(); event.getNDC(); event.getMDCCopy(); if(locationInfo) { event.getLocationInformation(); } event.getRenderedMessage(); event.getThrowableStrRep(); cb.add(event); if(evaluator.isTriggeringEvent(event)) { sendBuffer(); } }
/** * Set value for MDC property. * This adds the specified MDC property to the event. * Access to the MDC is not synchronized, so this * method should only be called when it is known that * no other threads are accessing the MDC. * @since 1.2.15 * @param propName * @param propValue */ public final void setProperty(final String propName, final String propValue) { if (mdcCopy == null) { getMDCCopy(); } if (mdcCopy == null) { mdcCopy = new Hashtable(); } mdcCopy.put(propName, propValue); }
/** * This removes the specified MDC property from the event. * Access to the MDC is not synchronized, so this * method should only be called when it is known that * no other threads are accessing the MDC. * @param propName the property name to remove * @since 1.2.16 */ public Object removeProperty(String propName) { if (mdcCopy == null) { getMDCCopy(); } if (mdcCopy == null) { mdcCopy = new Hashtable(); } return mdcCopy.remove(propName); } }
/** * Returns the set of properties * for the event. * * The returned set is unmodifiable by the caller. * * Provided for compatibility with log4j 1.3 * * @return Set an unmodifiable map of the properties. * @since 1.2.15 */ public Map getProperties() { getMDCCopy(); Map properties; if (mdcCopy == null) { properties = new HashMap(); } else { properties = mdcCopy; } return Collections.unmodifiableMap(properties); }
/** * Adds the event to the buffer. When full the buffer is flushed. */ public void append(LoggingEvent event) { event.getNDC(); event.getThreadName(); // Get a copy of this thread's MDC. event.getMDCCopy(); if (locationInfo) { event.getLocationInformation(); } event.getRenderedMessage(); event.getThrowableStrRep(); buffer.add(event); if (buffer.size() >= bufferSize) { flushBuffer(); } }
private void writeObject(ObjectOutputStream oos) throws java.io.IOException { // Aside from returning the current thread name the wgetThreadName // method sets the threadName variable. this.getThreadName(); // This sets the renders the message in case it wasn't up to now. this.getRenderedMessage(); // This call has a side effect of setting this.ndc and // setting ndcLookupRequired to false if not already false. this.getNDC(); // This call has a side effect of setting this.mdcCopy and // setting mdcLookupRequired to false if not already false. this.getMDCCopy(); // This sets the throwable sting representation of the event throwable. this.getThrowableStrRep(); oos.defaultWriteObject(); // serialize this event's level writeLevel(oos); }
private void writeObject(ObjectOutputStream oos) throws java.io.IOException { // Aside from returning the current thread name the wgetThreadName // method sets the threadName variable. this.getThreadName(); // This sets the renders the message in case it wasn't up to now. this.getRenderedMessage(); // This call has a side effect of setting this.ndc and // setting ndcLookupRequired to false if not already false. this.getNDC(); // This call has a side effect of setting this.mdcCopy and // setting mdcLookupRequired to false if not already false. this.getMDCCopy(); // This sets the throwable sting representation of the event throwable. this.getThrowableStrRep(); oos.defaultWriteObject(); // serialize this event's level writeLevel(oos); }
event.getThreadName(); event.getMDCCopy(); if (locationInfo) { event.getLocationInformation();
event.getMDCCopy(); event.getRenderedMessage(); event.getThrowableStrRep();
event.getThreadName(); event.getMDCCopy(); if(locationInfo) { event.getLocationInformation();
event.getMDCCopy(); event.getRenderedMessage(); event.getThrowableStrRep();
/** Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent. */ public void append(LoggingEvent event) { if(!checkEntryConditions()) { return; } event.getThreadName(); event.getNDC(); event.getMDCCopy(); if(locationInfo) { event.getLocationInformation(); } event.getRenderedMessage(); event.getThrowableStrRep(); cb.add(event); if(evaluator.isTriggeringEvent(event)) { sendBuffer(); } }