XLog::File - XLog backend for logging to file
XLog::File is a simple file logging backend. It is written in C++ and is fast.
It periodically checks for file existance by path and recteates it (and all folders) if it's gone.
Also supports autoflush.
Parameters are:
Path to log file. If it doesn't exist it will be created including all folders (like mkpath).
mkpath
If file could not be opened or written, an error message will be written on stderr and logger will be a stub (will do nothing when you log via XLog) until file can be written again.
Frequency in milliseconds of checking log file. If file is deleted or moved, creates file again, including all folders (if they are gone).
If file can not be created or written, an error message will be written on stderr and logger will be a stub (will do nothing when you log via XLog) until file can be written again.
If true will use buffered write. This is more efficient, but does not guarantees that all logs are written in case of application crash (like segfault). Unbuffered is less efficient but stable. Also buffered IO leads to trunkated lines in case of parrallel writes from different processes or threads.
Pronin Oleg <syber@crazypanda.ru>
Crazy Panda LTD
You may distribute this code under the same terms as Perl itself.
To install XLog::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XLog::File
CPAN shell
perl -MCPAN -e shell install XLog::File
For more information on module installation, please visit the detailed CPAN module installation guide.