Apache-Logmonster
view release on metacpan or search on metacpan
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)
If files to process are larger than 10MB, find a nicer way to sort them
rather than reading them all into a hash. Now I create two hashes, one
with data and one with dates. I sort the date hash, and using those
sorted hash keys, output the data hash to a sorted file. This is
necessary as wusage and http-analyze require logs to be fed in
chronological order. Look at awstats logresolvemerge as a possibility.
Add config file setting for the location of awstats.pl
SEE ALSO
http://tnpi.net/wiki/Logmonster
LICENCE AND COPYRIGHT
Copyright (c) 2003-2012, The Network People, Inc. (info@tnpi.net) All
rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
Neither the name of the The Network People, Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DIS CLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
( run in 1.185 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )