View previous topic :: View next topic |
Author |
Message |
Cheesepie Apprentice

Joined: 19 Jan 2004 Posts: 154
|
Posted: Tue Feb 14, 2006 10:25 pm Post subject: [ content removed, DMCA ] |
|
|
[ content removed, DMCA ]
Last edited by Cheesepie on Thu Feb 09, 2023 12:29 am; edited 2 times in total |
|
Back to top |
|
 |
cogitate n00b


Joined: 05 Dec 2003 Posts: 46 Location: Ontario, Canada
|
Posted: Wed Feb 15, 2006 1:29 am Post subject: |
|
|
If you want to split the log files for processing later, rather than have a separate log file for each host, you can use the split-logfile utility that comes with apache. It can also be used in a pipe situation if you want the logs to be created on the fly (without rotating the logs first) in a CustomLog directive.
Code: | CustomLog "| /usr/sbin/split-logfile2 /var/log/apache2" combined |
The only condition to this is that the log format must begin with '%v ' to log the virtual host, regardless of which method you use. |
|
Back to top |
|
 |
JustJoe Tux's lil' helper

Joined: 30 Jul 2005 Posts: 80
|
Posted: Wed Feb 15, 2006 7:16 am Post subject: |
|
|
You can configure the CustomLog directive for each virtual host, as well as an error log for each virtual host:
Code: |
<VirtualHost *:80>
ServerName foo.bar
DocumentRoot /var/www/foo.bar/htdocs/
ErrorLog logs/foo.bar_error_log
CustomLog logs/foo.bar_access_log combined
</VirtualHost>
<VirtualHost *:80>
ServerName bar.foo
DocumentRoot /var/www/bar.foo/htdocs/
ErrorLog logs/bar.foo_error_log
CustomLog logs/bar.foo_access_log combined
</VirtualHost> |
I choose for 'combined' logs, that is the logformat AWStats can handle. |
|
Back to top |
|
 |
Cheesepie Apprentice

Joined: 19 Jan 2004 Posts: 154
|
Posted: Wed Feb 15, 2006 5:34 pm Post subject: |
|
|
[ content removed, DMCA ]
Last edited by Cheesepie on Thu Feb 09, 2023 12:39 am; edited 1 time in total |
|
Back to top |
|
 |
JustJoe Tux's lil' helper

Joined: 30 Jul 2005 Posts: 80
|
Posted: Wed Feb 15, 2006 9:43 pm Post subject: |
|
|
Cheesepie wrote: |
FYI, this does not apply to my problem as I am using dynamic virtualhosts (not <virtualhost> blocks)
|
Ah, dynamic... missed that.  |
|
Back to top |
|
 |
murad n00b


Joined: 29 Oct 2003 Posts: 44 Location: Rio de Janeiro, Brasil
|
Posted: Sat Jun 10, 2006 12:34 am Post subject: |
|
|
If you want here is a reimplementation of apache2splitlogfile that will create 2 log files for each domain. One is the log file for the domain and the second is a log file with the traffic spent per month. _________________ Marcelo Mustafa Murad
http://dtmconsultoria.com |
|
Back to top |
|
 |
|