Apache-Logmonster
view release on metacpan or search on metacpan
Agnostic: If I want to switch to another log processor, it is simple and
painless. Each domain can have a preferred processor.
FEATURES
* Log Retrieval from one or many hosts
* Ouputs to webalizer, http-analyze, and AWstats.
* Automatic vhost detection
Logmonster generates config files as required (ie,
awstats.example.com.conf).
* Efficient
Reads directly from compressed log files to minimize network and
disk usage. Skips sorting if you only have logs from a single host.
* Flexible update intervals
runs monthly, daily, or hourly
* Reporting
logs an activity report and sends an email friendly report.
* Reliable
When something goes wrong, it provides useful error messages.
INSTALLATION
Step 1 - Download and install (it's FREE!)
https://www.tnpi.net/cart/index.php?crn=210&rn=385&action=show_detai
l
Install like typical perl modules:
perl Makefile.PL
make test
make install
To install the config file, 'make conf' or 'make newconf'. The
newconf target will overwrite any existing config file.
Step 2 - Edit logmonster.conf
vi /usr/local/etc/logmonster.conf
Step 3 - Edit your web servers config
Apache
Adjust the CustomLog and ErrorLog definitions. We make two
changes, appending %v (the vhost name) to the CustomLog and
adding cronolog to automatically rotate the log files.
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combined
CustomLog "| /usr/local/sbin/cronolog /var/log/apache/%Y/%m/%d/access.log" combined
ErrorLog "| /usr/local/sbin/cronolog /var/log/apache/%Y/%m/%d/error.log"
Lighttpd
accesslog.format = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v"
accesslog.filename = "|/usr/local/sbin/cronolog /var/log/http/%Y/%m/%d/access.log"
server.errorlog = "/var/log/http/error.log"
Step 4 - Test manually, then add to cron.
crontab -u root -e
5 1 * * * /usr/local/sbin/logmonster -i day
Step 5 - Read the FAQ
<http://tnpi.net/wiki/Logmonster_FAQ>
Step 6 - Enjoy
Enjoy the daily summary emails.
DIAGNOSTICS
Run in verbose mode (-v) to see additional status and error messages.
Verbosity can be increased by appending another -v, or even (-v -v -v)
maximal verbosity. If that is not enough, the source is with you.
Also helpful when troubleshooting is the ability to skip cleanup (so
logfiles do not have to be fetched anew) with the --noclean command line
option.
DEPENDENCIES
Not perl builtins
Compress::Zlib
Date::Parse (TimeDate)
Params::Validate
Builtins
Carp
Cwd
FileHandle
File::Basename
File::Copy
BUGS AND LIMITATIONS
Report problems to author. Patches welcome.
AUTHOR
Matt Simerson (msimerson@cpan.org)
ACKNOWLEDGEMENTS
Gernot Hueber - sumitted the daily userlogs feature
Lewis Bergman - funded authoring of several features
Raymond Dijkxhoorn - suggested not sorting the files for one log host
Earl Ruby - a better regexp for apache log date parsing
TODO
Add support for analog.
Add support for individual webalizer.conf file for each domain (this
will likely not happen until someone submits a diff. I don't use
webalizer any more).
Delete log files older than X days/months - low priority, it's easy and
low maintenance to manually delete a few months log files when I'm sure
I don't need them any longer.
Do something with error logs (other than just compress)
( run in 0.867 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )