Log::Any::Adapter::File - Simple adapter for logging to files
version 1.717
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', );
This simple built-in Log::Any adapter logs each message to the specified file, with a datestamp prefix and newline appended. The file is opened for append with autoflush on. If flock is available, the handle will be locked when writing.
flock
The log_level attribute may be set to define a minimum level to log.
log_level
The binmode attribute may be set to define a PerlIO layer string to use when opening the file. The default is :utf8.
binmode
:utf8
Category is ignored.
Log::Any, Log::Any::Adapter
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.
To install Log::Any, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Any
CPAN shell
perl -MCPAN -e shell install Log::Any
For more information on module installation, please visit the detailed CPAN module installation guide.