package Log::ger::Manual::Tutorial::400_Output;

# DATE
# VERSION

1;
# ABSTRACT: Logging outputs

__END__

=pod

=encoding UTF-8

=head1 NAME

Log::ger::Manual::Tutorial::400_Output - Logging outputs

=head1 VERSION

version 0.033.000

=head1 DESCRIPTION

=over

=item * L<Log::ger::Manual::Tutorial::410_Output_Screen>

=item * L<Log::ger::Manual::Tutorial::420_Output_File>

=item * L<Log::ger::Manual::Tutorial::421_Output_SimpleFile>

=item * L<Log::ger::Manual::Tutorial::422_Output_FileWriteRotate>

=item * L<Log::ger::Manual::Tutorial::430_Output_Syslog>

=item * L<Log::ger::Manual::Tutorial::470_Output_DirwriteRotate>

=item * L<Log::ger::Manual::Tutorial::481_Output_Composite>

=item * L<Log::ger::Manual::Tutorial::490_WritingAnOutputPlugin>

=back

=head1 PRODUCING AND CONSUMING

The act of logging:

 log_info("This is just an informational message");
 log_warn("This is a warning, you have been warned");

is called I<producing> the log. By default the messages don't go anywhere so you
do not see them. When an application is run, logging output(s) (and level) are
set up; only then the messages will be shown, either to the terminal (screen),
file, or some other destination. The act of taking a log message and showing it
through some output is called I<consuming> the log.

=head1 CHOOSING AN OUTPUT

There are a variety of output modules you can choose in Log::ger, for example:

=over

=item * L<Log::ger::Output::Screen>

=item * L<Log::ger::Output::File>

=item * L<Log::ger::Output::Syslog>

=back

Search CPAN for more C<Log::ger::Output::*> modules. And when you don't find one
suitable for your needs, it's easy to write your own (see
L<490_WritingAnOutputPlugin|Log::ger::Manual::Tutorial::490_WritingAnOutputPlugin>).

To select an output:

 use Log::ger::Output 'Screen'; # note: NOT 'use Log::ger::Output::Screen'!

or:

 use Log::ger::Output;
 Log::ger::Output->set('Screen');

To pass configuration parameters to an output module:

 use Log::ger::Output File => (path => '/tmp/app.log', lazy => 1);

or:

 use Log::ger::Output;
 Log::ger::Output->set(File => (path => '/tmp/app.log', lazy => 1));

If you want to output to two or more destinations, you can use
L<Log::ger::Output::Composite> which multiplexes the message to multiple
outputs:

 use Log::ger::Output Composite => (
     outputs => {
         Screen => {},
         File   => { conf => {path=>'/tmp/app.log', lazy=>1} },
     },
 );

Apart from multiplexing output, Composite can also set per-output level,
per-category level, and per-output per-category level. We will cover Composite
in subsequent tutorial post.

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2020, 2019, 2018, 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.

=cut