E
E
Evgeny Yazev2020-06-10 13:20:57
Apache HTTP Server
Evgeny Yazev, 2020-06-10 13:20:57

How to exclude responses from apache access log 200,300?

Good afternoon, colleagues! Tell me about Apache log config settings.
I want to exclude entries about 200,300 responses from access.log, but a simple change to loglevel error does not help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2020-06-10
@yazevjohn

You can customize your LogFormat

Modifiers
Particular items can be restricted to print only for responses with specific HTTP status codes by placing a comma-separated list of status codes immediately following the "%". The status code list may be preceded by a "!" to indicate negation.

Then %!list the response codes that need to be excluded, separated by commas.
%!200,300,301,302
Or make an exception through expressions
CustomLog "logs/access_log" combined "expr=!%{REQUEST_STATUS} -in {'200', '301','302'}"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question