# phpman > man > Log::Any::Adapter::File(3pm)

## NAME
    [Log::Any::Adapter::File](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter%3A%3AFile/markdown) - Simple adapter for logging to files

## VERSION
    version 1.710

## SYNOPSIS
        use [Log::Any::Adapter](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter/markdown) ('File', '/path/to/file.log');

        # or

        use [Log::Any::Adapter](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter/markdown);
        ...
        [Log::Any::Adapter](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter/markdown)->set('File', '/path/to/file.log');

        # with minimum level 'warn'

        use [Log::Any::Adapter](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter/markdown) (
            'File', '/path/to/file.log', log_level => 'warn',
        );

## DESCRIPTION
    This simple built-in [Log::Any](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny/markdown) 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.

    The "log_level" attribute may be set to define a minimum level to log.

    The "binmode" attribute may be set to define a PerlIO layer string to use when opening the file.
    The default is ":utf8".

    Category is ignored.

## SEE ALSO
    [Log::Any](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny/markdown), [Log::Any::Adapter](https://www.chedong.com/phpMan.php/perldoc/Log%3A%3AAny%3A%3AAdapter/markdown)

## AUTHORS
    *   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>>

## COPYRIGHT AND LICENSE
    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.

