{
    "mode": "perldoc",
    "parameter": "Log::Log4perl::Filter::Boolean",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Log%3A%3ALog4perl%3A%3AFilter%3A%3ABoolean/json",
    "generated": "2026-06-10T16:29:56Z",
    "synopsis": "log4perl.logger = WARN, AppWarn, AppError\nlog4perl.filter.Match1       = sub { /let this through/ }\nlog4perl.filter.Match2       = sub { /and that, too/ }\nlog4perl.filter.MyBoolean       = Log::Log4perl::Filter::Boolean\nlog4perl.filter.MyBoolean.logic = Match1 || Match2\nlog4perl.appender.Screen        = Log::Dispatch::Screen\nlog4perl.appender.Screen.Filter = MyBoolean\nlog4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout",
    "sections": {
        "NAME": {
            "content": "Log::Log4perl::Filter::Boolean - Special filter to combine the results of others\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "log4perl.logger = WARN, AppWarn, AppError\n\nlog4perl.filter.Match1       = sub { /let this through/ }\nlog4perl.filter.Match2       = sub { /and that, too/ }\nlog4perl.filter.MyBoolean       = Log::Log4perl::Filter::Boolean\nlog4perl.filter.MyBoolean.logic = Match1 || Match2\n\nlog4perl.appender.Screen        = Log::Dispatch::Screen\nlog4perl.appender.Screen.Filter = MyBoolean\nlog4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Sometimes, it's useful to combine the output of various filters to arrive at a log/no log\ndecision. While Log4j, Log4perl's mother ship, chose to implement this feature as a filter\nchain, similar to Linux' IP chains, Log4perl tries a different approach.\n\nTypically, filter results will not need to be passed along in chains but combined in a\nprogrammatic manner using boolean logic. \"Log if this filter says 'yes' and that filter says\n'no'\" is a fairly common requirement but hard to implement as a chain.\n\n\"Log::Log4perl::Filter::Boolean\" is a special predefined custom filter for Log4perl which\ncombines the results of other custom filters in arbitrary ways, using boolean expressions:\n\nlog4perl.logger = WARN, AppWarn, AppError\n\nlog4perl.filter.Match1       = sub { /let this through/ }\nlog4perl.filter.Match2       = sub { /and that, too/ }\nlog4perl.filter.MyBoolean       = Log::Log4perl::Filter::Boolean\nlog4perl.filter.MyBoolean.logic = Match1 || Match2\n\nlog4perl.appender.Screen        = Log::Dispatch::Screen\nlog4perl.appender.Screen.Filter = MyBoolean\nlog4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout\n\n\"Log::Log4perl::Filter::Boolean\"'s boolean expressions allow for combining different appenders\nby name using AND (&& or &), OR (|| or |) and NOT (!) as logical expressions. Parentheses are\nused for grouping. Precedence follows standard Perl. Here's a bunch of examples:\n\nMatch1 && !Match2            # Match1 and not Match2\n!(Match1 || Match2)          # Neither Match1 nor Match2\n(Match1 && Match2) || Match3 # Both Match1 and Match2 or Match3\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Log::Log4perl::Filter, Log::Log4perl::Filter::LevelMatch, Log::Log4perl::Filter::LevelRange,\nLog::Log4perl::Filter::MDC, Log::Log4perl::Filter::StringRange\n",
            "subsections": []
        },
        "LICENSE": {
            "content": "Copyright 2002-2013 by Mike Schilli <m@perlmeister.com> and Kevin Goess <cpan@goess.org>.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Please contribute patches to the project on Github:\n\nhttp://github.com/mschilli/log4perl\n\nSend bug reports or requests for enhancements to the authors via our\n\nMAILING LIST (questions, bug reports, suggestions/patches): log4perl-devel@lists.sourceforge.net\n\nAuthors (please contact them via the list above, not directly): Mike Schilli\n<m@perlmeister.com>, Kevin Goess <cpan@goess.org>\n\nContributors (in alphabetical order): Ateeq Altaf, Cory Bennett, Jens Berthold, Jeremy Bopp,\nHutton Davidson, Chris R. Donnelly, Matisse Enzer, Hugh Esco, Anthony Foiani, James FitzGibbon,\nCarl Franks, Dennis Gregorovic, Andy Grundman, Paul Harrington, Alexander Hartmaier David Hull,\nRobert Jacobson, Jason Kohles, Jeff Macdonald, Markus Peter, Brett Rann, Peter Rabbitson, Erik\nSelberg, Aaron Straup Cope, Lars Thegler, David Viner, Mac Yang.\n",
            "subsections": []
        }
    },
    "summary": "Log::Log4perl::Filter::Boolean - Special filter to combine the results of others",
    "flags": [],
    "examples": [],
    "see_also": []
}