<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Log::ger::Output::Composite - Composite output

VERSION
    version 0.015

SYNOPSIS
     use Log::ger::Output Composite =&gt; (
         outputs =&gt; {
             # single screen output
             Screen =&gt; {
                 conf   =&gt; { use_color=&gt;1 },                        # output config, optional.
                 level  =&gt; 'info',                                  # set per-output level. optional.
                 layout =&gt; [Pattern =&gt; {format=&gt;'%d (%F:%L)&gt; %m'}], # add per-output layout, optional.
             },
             # multiple file outputs
             File =&gt; [
                 {
                     conf  =&gt; { path=&gt;'/var/log/myapp.log' },
                     level =&gt; 'warn',
                     category_level =&gt; {                            # set per-category, per-output level. optional.
                         # don't log MyApp::Security messages to this file
                         'MyApp::Security' =&gt; 'off',
                         ...
                     },
                 },
                 {
                     conf =&gt; { path =&gt; '/var/log/myapp-security.log' },
                     level =&gt; 'warn',
                     category_level =&gt; {
                         # only MyApp::Security messages go to this file
                         'MyApp::Security' =&gt; 'warn',
                         ...
                     },
                 },
             ],
         },
         category_level =&gt; {                                        # set per-category level. optional.
            'MyApp::SubModule1' =&gt; 'info',
            'MyApp::SubModule2' =&gt; 'debug',
            ...
         },
     );
     use Log::ger;

     log_warn "blah...";

DESCRIPTION
    This is a Log::ger output that can multiplex output to several outputs
    and do filtering on the basis of per-category level, per-output level,
    or per-output per-category level. It can also apply per-output layout.

CONFIGURATION
  outputs =&gt; hash
    Specify outputs. It's a hash with output name as keys and output
    specification as values.

    Output name is the name of output module without the
    "Log::ger::Output::" prefix, e.g. Screen or File.

    Output specification is either a hashref or arrayref of hashrefs to
    specify multiple outputs per type (e.g. if you want to output to two
    File's). Known hashref keys:

    *   conf =&gt; hashref

        Specify output configuration. Optional. See each output
        documentation for the list of available configuration parameters.

    *   level =&gt; str|int|[min, max]

        Specify per-output level. Optional. If specified, logging will be
        done at this level instead of the general level. For example, if
        this is set to "debug" then debug messages and higher will be sent
        to output even though the general level is "warn". Vice versa, if
        this is set to "error" then even though the general level is "warn",
        warning messages won't be sent to this output; only "error" messages
        and higher will be sent.

        You can specify a single level (e.g. 1 or "trace") or a two-element
        array to specify minimum and maximum level (e.g. "&lt;["trace",
        "info"]"&gt;). If you accidentally mix up minimum and maximum, this
        module will helpfully fix it for you.

    *   category_level =&gt; hash

        Specify per-output per-category level. Optional. Hash key is
        category name, value is level (which can be a string/numeric level
        or a two-element array containing minimum and maximum level).

    *   layout =&gt; [Name =&gt; {conf1=&gt;..., conf2=&gt;..., ...}]

        Specify per-output layout. Optional. Value is two-element array
        containing layout name (without the "Log::ger::Layout::" prefix,
        e.g. Pattern) and configuration hash. See each layout module
        documentation for the list of available configuration parameters.

        Note that if you also use a layout module outside of Composite
        configuration, e.g.:

         use Log::ger::Output Composite =&gt; (...);
         use Log::ger::Layout Pattern =&gt; (format =&gt; '...');

        then both layouts will be applied, the general layout will be
        applied before the per-output layout.

  category_level =&gt; hash
    Specify per-category level. Optional. Hash key is category name, value
    is level (which can be a string/numeric level or a two-element array
    containing minimum and maximum level).

FAQS
  Why doesn't re-setting log level using Log::ger::Util::set_level() work?
    This output plugin sets its own levels and logs using a multilevel
    routine (which gets called for all levels). Re-setting log level
    dynamically via Log::ger::Util's "set_level" will not work as intended,
    which is fortunate or unfortunate depending on your need.

    If you want to override all levels settings with a single value, you can
    use "Log::ger::Output::Composite::set_level", for example:

     Log::ger::Util::set_level('trace'); # also set this too
     Log::ger::Output::Composite::set_level('trace');

    This sets an internal level setting which is respected and has the
    highest precedence so all levels settings will use this instead. If
    previously you have:

     Log::ger::Output-&gt;set(Composite =&gt; {
         default_level =&gt; 'error',
         outputs =&gt; {
             File =&gt; {path=&gt;'/foo', level=&gt;'debug'},
             Screen =&gt; {level=&gt;'info', category_level=&gt;{MyApp=&gt;'warn'}},
         },
         category_level =&gt; {
             'MyApp::SubModule1' =&gt; 'debug',
         },
     });

    then after the "Log::ger::Output::Composite::set_level('trace')", all
    the above per-category and per-output levels will be set to "trace".

ENVIRONMENT
  LOG_LOG_GER_OUTPUT_COMPOSITE_CODE
    Bool. If set to true will print the generated logger source code to
    stderr.

SEE ALSO
AUTHOR
    perlancar &lt;perlancar@cpan.org&gt;

COPYRIGHT AND LICENSE
    This software is copyright (c) 2020, 2019, 2017 by perlancar@cpan.org.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

</pre></body></html>