log4shib::Filter(3)
π
log4shib::Filter(3) β the Library Functions Manual page β¨
okay so bestie, this is log4shib::Filter(3) from the Library Functions Manual, and it's giving βabstract base class for custom logging event filtering.β If you're here, you're probably about to build your own filter chain. Let's get into it. π«Ά
πΈ NAME πΈ
log4shib::Filter β users should extend this class to implement customized logging event filtering. periodt. π
β¨ SYNOPSIS β¨
Include it like this, bestie:
#include <Filter.hh>
π Public Types π
The enum decision situation:
enum Decision { DENY = -1, NEUTRAL = 0, ACCEPT = 1 }
π Public Member Functions π
Filter ()β Default Constructor for Filter.virtual ~Filter ()β Destructor for Filter.virtual void setChainedFilter (Filter *filter)β Set the next Filter in the Filter chain.virtual Filter * getChainedFilter ()β Get the next Filter in the Filter chain.virtual Filter * getEndOfChain ()β Get the last Filter in the Filter chain.virtual void appendChainedFilter (Filter *filter)β Add a Filter to the end of the Filter chain.virtual Decision decide (const LoggingEvent &event)β Decide whether to accept or deny a LoggingEvent.
π Protected Member Functions π
virtual Decision _decide (const LoggingEvent &event)=0β Decide whether this Filter accepts or denies the given LoggingEvent.
π Detailed Description π
Users should extend this class to implement customized logging event filtering. That's the whole assignment, bestie. π
Note that log4shib::Category and lof4cpp::Appender have built-in filtering rules. Yes, the page says lof4cpp β I'm not fixing it, I'm just reporting. It is suggested that you first use and understand the built-in rules before rushing to write your own custom filters. Learn the built-ins first, then go off. π«Ά
This abstract class assumes and also imposes that filters be organized in a linear chain. The decide(LoggingEvent) method of each filter is called sequentially, in the order of their addition to the chain.
The decide(LoggingEvent) method must return a Decision value, either DENY, NEUTRAL or ACCCEPT (the page literally spells it with the extra C there; the enum enumerator is ACCEPT).
- If the value
DENYis returned, then the log event is dropped immediately without consulting with the remaining filters. - If the value
NEUTRALis returned, then the next filter in the chain is consulted. If there are no more filters in the chain, then the log event is logged. Thus, in the presence of no filters, the default behaviour is to log all logging events. - If the value
ACCEPTis returned, then the log event is logged without consulting the remaining filters.
The philosophy of log4shib filters is largely inspired from the Linux ipchains.
π Member Enumeration Documentation π
π« enum log4shib::Filter::Decision
Enumerator
DENYNEUTRALACCEPT
The values up in the enum are DENY = -1, NEUTRAL = 0, ACCEPT = 1. no cap. π
π Constructor & Destructor Documentation π
πΈ log4shib::Filter::Filter ()
Default Constructor for Filter. cute.
πΈ log4shib::Filter::~Filter () [virtual]
Destructor for Filter. bye bestie. π
π₯ Member Function Documentation π₯
π virtual Decision log4shib::Filter::_decide (const LoggingEvent & event) β [protected], [pure virtual]
Decide whether this Filter accepts or denies the given LoggingEvent. Actual implementation of Filter should override this method and not decide(LoggingEvent&).
Parameters
eventβ The LoggingEvent to decide on.
Returns
- The Decision
π¦ void log4shib::Filter::appendChainedFilter (Filter * filter) [virtual]
Add a Filter to the end of the Filter chain. Convience method for getEndOfChain()->setChainedFilter(filter).
Parameters
filterβ The filter to add to the end of the chain.
π§ Filter::Decision log4shib::Filter::decide (const LoggingEvent & event) [virtual]
Decide whether to accept or deny a LoggingEvent. This method will walk the entire chain until a non neutral decision has been made or the end of the chain has been reached.
Parameters
eventβ The LoggingEvent to decide on.
Returns
- The Decision
π¦ Filter * log4shib::Filter::getChainedFilter () [virtual]
Get the next Filter in the Filter chain.
Returns
- The next Filter or
NULLif the current filter is the last in the chain
π¦ Filter * log4shib::Filter::getEndOfChain () [virtual]
Get the last Filter in the Filter chain.
Returns
- The last Filter in the Filter chain
π¦ void log4shib::Filter::setChainedFilter (Filter * filter) [virtual]
Set the next Filter in the Filter chain.
Parameters
filterβ The filter to chain
π Author π
Generated automatically by Doxygen for log4shib from the source code. Doxygen ate, honestly. π
π and that's the page, bestie. Source/version: log4shib, Version 2.0.1. Page: log4shib::Filter(3). The footer doesn't list a date, so I'm not inventing one β mwah. πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms