Log::An...er::File(3)

πŸ’– NAME πŸ’–

Log::Any::Adapter::File β€” bestie's little adapter for logging straight into files, no cap ✨


🌸 VERSION 🌸

version 1.718 β€” yes she's got a version number, she's official πŸŽ€


✨ SYNOPSIS ✨

okay so here's the vibe, three ways to do the thing:

use Log::Any::Adapter ('File', '/path/to/file.log');

# or

use Log::Any::Adapter;
...
Log::Any::Adapter->set('File', '/path/to/file.log');

# with minimum level 'warn'

use Log::Any::Adapter (
    'File', '/path/to/file.log', log_level => 'warn',
);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so listen. This simple built-in Log::Any adapter logs every single message to the file you specify β€” and it's giving very much datestamp prefix + newline appended, periodt. πŸ“

The file gets opened for append with autoflush on, so nothing sits around waiting to be written, she's impatient in the best way πŸ’…

And if "flock" is available? The handle gets locked when writing. Mutual exclusion, iconic behavior, no two processes stepping on each other's toes 🫢

The "log_level" attribute may be set to define a minimum level to log β€” set it and everything below that level just doesn't make the cut, sorry babe πŸ’€

The "binmode" attribute may be set to define a PerlIO layer string to use when opening the file. The default is ":utf8" β€” so yes, your emoji and your accented characters are safe, we love to see it 🌈

Category is ignored. She said "I don't see her" πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

  • Log::Any
  • Log::Any::Adapter

go read those too, they're the main characters of this whole saga ⭐


πŸŽ€ AUTHORS πŸŽ€

the literal legends who made this happen:

  • Jonathan Swartz <swartz@pobox.com>
  • David Golden <dagolden@cpan.org>
  • Doug Bell <preaction@cpan.org>
  • Daniel Pittman <daniel@rimspace.net>
  • Stephen Thirlwall <sdt@cpan.org>

This software is copyright (c) 2017 by Jonathan Swartz, David Golden, and Doug Bell.

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


ok bestie that's the whole page 🧚 and just so you know who's speaking: this is Log::An...er::File(3) from the User Contributed Perl Documentation, footer energy being perl v5.42.0 and dated 2025-07-28. mwah, go log something πŸ’–βœ¨πŸ“

πŸ“¦ where this page comes from