Net::SolarWinds::FileRotationBase - base file rotation framework
use base qw(Net::SolarWinds::FileRotationBase);
This modle is intended to be used as a base module for modules that require an auto file rotation framework. Auto file rotation is handled by file size.
The object constructor for this class has a collection of optional arguments. Arguments are passed to the constructor in key value pairs.
Constructor useage example:
my $fr=new Net::SolarWinds::FileRotationBase(folder=>'/var/logs/myapp',basefilename=>'someapp');
Argument list is as follows (default values shown):
# Fully quallified system path to the log file filename=>'/path/to/some/file.log' # sets the folder files will be created and rotated under folder=>'.', # sets the basefilename basefilename => 'DefaultFile', # used to concat the folder and filenames togeather pathconncat => '/', # sets thefile extention to be used ext => 'log', # sets the number of files to keep in rotation maxfilecount => 3, # sets the max file size ( 8mb ) maxsize => 1024 * 1024 * 8, # sets the autoflush state ( handy for real time info in the file ) autoflush => 1, # sets the file auto rotation flag autorotate => 1, # glob ref will be overwritten with the current fh mirror=>undef|\*STDERR
Sets a file handle to be mirroed to:
Retuns the filename of the active file.
Returns the active filehandle.
Forces log files to be rotated now!
Closes the current active file handle.
$fr->write_to_file("Something to write to my file\n");
Writes the list of arguments to the target file.