log4cplus::spi::MDCMatchFilter Class Reference

This is a simple filter based on the key/value pair stored in MDC. More...

`#include <filter.h>`

Inheritance diagram for log4cplus::spi::MDCMatchFilter:
[legend]
Collaboration diagram for log4cplus::spi::MDCMatchFilter:
[legend]

## Public Member Functions

| MDCMatchFilter ()
| MDCMatchFilter (const log4cplus::helpers::Properties &p)
virtual FilterResult | decide (const InternalLoggingEvent &event) const
| Returns `NEUTRAL` is there is no string match.
Public Member Functions inherited from log4cplus::spi::Filter
| Filter ()
virtual | ~Filter ()
void | appendFilter (FilterPtr filter)
| Appends `filter` to the end of this filter chain.
Public Member Functions inherited from log4cplus::helpers::SharedObject
void | addReference () const LOG4CPLUS_NOEXCEPT
void | removeReference () const

## Additional Inherited Members

Public Attributes inherited from log4cplus::spi::Filter
FilterPtr | next
| Points to the next filter in the filter chain.
Public Attributes inherited from log4cplus::helpers::SharedObject
thread::Mutex | access_mutex
Protected Member Functions inherited from log4cplus::helpers::SharedObject
| SharedObject ()
| SharedObject (const SharedObject &)
| SharedObject (SharedObject &&)
virtual | ~SharedObject ()
SharedObject & | operator= (const SharedObject &) LOG4CPLUS_NOEXCEPT
SharedObject & | operator= (SharedObject &&) LOG4CPLUS_NOEXCEPT

## Detailed Description

This is a simple filter based on the key/value pair stored in MDC.

The filter admits four options NeutralOnEmpty, MDCKeyToMatch MDCValueToMatch and AcceptOnMatch.

If `NeutralOnEmpty` is true and `MDCKeyToMatch` or `MDCValueToMatch` is empty then `NEUTRAL` is returned.

If `NeutralOnEmpty` is true and the string returned by event.getMDC(MDCKeyToMatch) is empty then `NEUTRAL` is returned.

If the string returned by event.getMDC(MDCKeyToMatch) matches `MDCValueToMatch`, then if AcceptOnMatch is true, `ACCEPT` is returned, and if AcceptOnMatch is false, `DENY` is returned.

If the string returned by event.getMDC(MDCKeyToMatch) does not match `MDCValueToMatch`, then if AcceptOnMatch is true, `DENY` is returned, and if AcceptOnMatch is false, `ACCEPT` is returned.

Definition at line 374 of file filter.h.

## Constructor & Destructor Documentation

## MDCMatchFilter() [1/2]

log4cplus::spi::MDCMatchFilter::MDCMatchFilter | ( |  | ) |

## MDCMatchFilter() [2/2]

log4cplus::spi::MDCMatchFilter::MDCMatchFilter | ( | const log4cplus::helpers::Properties & | p | ) |

## Member Function Documentation

## decide()

virtual FilterResult log4cplus::spi::MDCMatchFilter::decide | ( | const InternalLoggingEvent & | event | ) | const

virtual

Returns `NEUTRAL` is there is no string match.

Implements log4cplus::spi::Filter.

References LOG4CPLUS_PRIVATE.

The documentation for this class was generated from the following file:

- filter.h