Hello,

we want replace our legacy proprietary logging framework.

One important feature of our current logging framework is the so called 
'profile controlled filtering'.
There exist different filtering profiles like 'production', 'test' or 
'development'. The profile to use
is selected by a system property named 'STAGE'.
Each filtering profile has its filter combination:
* production: Log level is ERROR or higher, except, if marker is HEARTBEAT, 
then the log level should be INFO or higher.
* test: Log level is WARNING or higher, except if marker is one of [HEARTBEAT, 
DB], then the log level is DEBUG or higher.
* development: Log level is INFO, except if marker is one of [HEARTBEAT, DB, 
ENTRY].
Additionally there is a default filter combination. Default filter combination 
is used if STAGE is unknown or no STAGE is defined.

A single filter combination can be defined with CompositeFilter. E.g. for the 
production profile the follow CompositeFilter can be used:
      <Filters>
        <ThresholdFilter level="INFO" onMatch="NEUTRAL" onMismatch="DENY" />
        <ThresholdFilter level="ERROR" onMatch="ACCEPT" onMismatch="NEUTRAL" />
        <MarkerFilter marker="HEARTBEAT" onMatch="ACCEPT" onMismatch="DENY" />
      </Filters>


But how can I select the profile (this means here the CompositeFilter) by 
System-Lookup?
Is there any recommended way for profile controlling?

For all profiles the same appenders are used. The only difference is the filter 
combination.

Thanks a lot!
Stefan Mahler



--
Stefan Mahler                           http://www.icongmbh.de
Application Development
icon Systemhaus GmbH            Tel. +49 711 806098-167
Hauptstätter Straße 70
70178 Stuttgart                         Fax. +49 711 806098-299


Geschäftsführer: Uwe Seltmann, Andreas Schwegler
HRB Stuttgart 17655
USt-IdNr.: DE 811944121

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to