sharingsunshine
asked on
Need Access Log and Error Log Have Same Format
I have a script that reads the access_log files and counts how many times an ip has accessed the site. This works great and helps me to find bots I want to remove. My question is, how do I get the access files and error log files to look the same?
I use a vhosts.conf file and in one of the virtual directories we have the following:
When I add the word combined to the error log format line I get the following error:
The format of the access_log is the one I want the errors log to follow.
So, how can I get the log format the same on both? This is because it gives me the information I need and also will permit the script to read the error logs too.
Thanks,
I use a vhosts.conf file and in one of the virtual directories we have the following:
<VirtualHost 172.31.8.214:80>
ServerName www.theherbsplace.com
ServerAlias theherbsplace.com
DocumentRoot /data/web/theherbsplace.com
ErrorLog /data/log/php_errors_thp.log
CustomLog /data/log/access_thp.log combined
RewriteEngine On
<Directory /data/web/theherbsplace.com/>
Require all granted
</Directory>
</VirtualHost>
When I add the word combined to the error log format line I get the following error:
AH00526: Syntax error on line 7 of /etc/httpd/conf.d/vhosts.conf:
ErrorLog takes one argument, The filename of the error log
The format of the access_log is the one I want the errors log to follow.
So, how can I get the log format the same on both? This is because it gives me the information I need and also will permit the script to read the error logs too.
Thanks,
ASKER
I saw that and didn't see a readily apparent answer.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the help. Kent you gave most of the information but Prabhin was more specific and I didn't have to dig it out of the docs. So it was much easier to understand.
https://httpd.apache.org/docs/2.4/mod/core.html#errorlogformat