Log::D...Rotate(3pm)

πŸ’– NAME πŸ’–

Log::Dispatch::FileWriteRotate β€” log to files that archive and rotate themselves, using File::Write::Rotate. It's giving "my logs stay tidy while I stay unbothered." ✨


🌸 VERSION 🌸

This doc is for version 0.062 of Log::Dispatch::FileWriteRotate, which comes from the Perl distribution Log-Dispatch-FileWriteRotate, released on 2021-07-21. πŸ’…


✨ SYNOPSIS ✨

okay bestie, here's the whole vibe:

use Log::Dispatch::FileWriteRotate;

my $file = Log::Dispatch::FileWriteRotate(
    min_level => 'info',

    # will be passed to File::Write::Rotate
    dir       => '/var/log',
    prefix    => 'myapp',
    suffix    => '.log',
    period    => 'monthly',
    size      => 25*1024*1024,
    histories => 12,
);

$file->log(level => 'info', message => "Your comment\n");

πŸ¦‹ DESCRIPTION πŸ¦‹

So this module does basically the same job as Log::Dispatch::FileRotate, but it's built on top of File::Write::Rotate as its backend. And the way that matters? It means it plays so nicely with other modules that also use File::Write::Rotate as their backend β€” like Tie::Handle::FileWriteRotate or Process::Govern. Interoperability slay. πŸ”₯


🫢 CONTRIBUTOR 🫢

Steven Haryanto <sharyanto@cpan.org> β€” thank you bestie, iconic contribution. πŸ’–


πŸ‘‘ METHODS πŸ‘‘

new(%args)

The constructor, bestie. It takes a hash of parameters, and these are the options that are valid: min_level and max_level (go peek at the Log::Dispatch documentation for those), plus dir, prefix, suffix, period, size, and histories (those ones live over in File::Write::Rotate). 🌈

log_message(message => STR)

Sends a message off to wherever it's supposed to go. Generally you should not call this directly β€” it's meant to be reached through the log() method (in LLog::Dispatch::Output>). Yes, that's literally how it's written in the source doc, no cap, we reproduce it exactly. πŸ™ˆ

fwr

Exposes the File::Write::Rotate object. You can access this object for stuff like compressing logfiles:

$file->fwd->compress;

(That line is verbatim from the doc too β€” copy it exactly, bestie, don't get creative with it. πŸ’€)


🌟 HOMEPAGE 🌟

Please visit the project's homepage at:

https://metacpan.org/release/Log-Dispatch-FileWriteRotate


πŸŽ€ SOURCE πŸŽ€

Source repository is at:

https://github.com/perlancar/perl-Log-Dispatch-FileWriteRotate


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests on the bugtracker website:

https://rt.cpan.org/Public/Dist/Display.html?Name=Log-Dispatch-FileWriteRotate

When you submit a bug or a request, please include a test-file or a patch to an existing test-file that illustrates the bug or the desired feature. Receipts only, bestie. πŸ“


🧚 SEE ALSO 🧚

  • Log::Dispatch
  • File::Write::Rotate
  • Log::Dispatch::FileRotate

πŸ’œ AUTHOR πŸ’œ

perlancar <perlancar@cpan.org> β€” main character energy fr fr. πŸ‘‘


This software is copyright (c) 2021, 2019, 2015, 2013, 2012 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. 🫢


and that's the whole page, bestie! πŸ’… signed off from perl v5.32.1, dated 2021-09-27, and yes, the manual name up top is Log::D...Rotate(3pm) β€” go forth and rotate those logs. periodt. πŸŽ€βœ¨
πŸ“¦ where this page comes from