LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to get the same apache error log of Debian 8 like Debian 7? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-get-the-same-apache-error-log-of-debian-8-like-debian-7-a-4175554303/)

Aeolustw 09-23-2015 11:01 AM

How to get the same apache error log of Debian 8 like Debian 7?
 
I have two server and use "LogLevel info" in these two /etc/apache2/apache2.conf ,and also have the same default "LogFormat"
like these:
Code:

LogFormat "v:p h l u t \"r\" >s O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

but /var/log/apache2/error.log are different in these two server:
Debian 7 -- Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u3 x86_64 GNU/Linux
Apache version 2.2.22
Quote:

[Wed Sep 23 20:29:20 2015] [error] [client 42.75.41.54] File does not exist: /var/www/999
Debian 8 -- Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u3 (2015-08-04) x86_64 GNU/Linux
Apache version 2.4.10
Quote:

[Wed Sep 23 20:28:00.426214 2015] [core:info] [pid 1649] [client 42.75.41.54:25993] AH00128: File does not exist: /var/www/html/999
Is it possible to edit something of Debian 8 and get the same apache error log like Debian 7?

Thanks.

bathory 09-23-2015 02:04 PM

Quote:

Is it possible to edit something of Debian 8 and get the same apache error log like Debian 7?
I'm afraid no
apache-2.4 uses the new ErrorLogFormat directive to define the error_log format
According to the documentation, the closest to apache-2.2 error_log you can get, is by using:
Code:

ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"
If you want to suppress also the AH00128 message, you need to recompile core.c

Regards

Aeolustw 09-23-2015 07:56 PM

I got it.
Quote:

apache-2.4 uses the new ErrorLogFormat directive to define the error_log format
Thanks for the quick and useful reply.
I care about this change, because i used iptables to drop some ip with catching logs.
To editing my customized iptables shell is my hard work now.

bathory 09-24-2015 01:50 AM

Quote:

Originally Posted by Aeolustw (Post 5424758)
I got it.

Thanks for the quick and useful reply.
I care about this change, because i used iptables to drop some ip with catching logs.
To editing my customized iptables shell is my hard work now.

You could use fail2ban for this

Regards

Aeolustw 09-24-2015 09:15 AM

Thanks for your good advice, i will figure it out.


All times are GMT -5. The time now is 10:50 AM.