Skip to content

Commit 5203db1

Browse files
committed
hide kube-probe logs
1 parent b3b920d commit 5203db1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apache/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ RUN sed -i \
1717
# Use real client IP in logs (from X-Forwarded-For)
1818
RUN sed -i 's/%h/%a/g' /usr/local/apache2/conf/httpd.conf
1919

20-
# Switch logging to combined (Adds User-Agent and Referer)
21-
RUN sed -i 's/CustomLog \/proc\/self\/fd\/1 common/CustomLog \/proc\/self\/fd\/1 combined/' /usr/local/apache2/conf/httpd.conf
20+
RUN echo 'SetEnvIf User-Agent "kube-probe" dontlog' >> /usr/local/apache2/conf/httpd.conf
21+
22+
# Switch logging to combined (Adds User-Agent, Referer and hides kube-probe logs)
23+
RUN sed -i 's/CustomLog \/proc\/self\/fd\/1 common/CustomLog \/proc\/self\/fd\/1 combined env=!dontlog/' /usr/local/apache2/conf/httpd.conf
2224

2325
RUN echo "Include conf/extra/remoteip.conf" >> /usr/local/apache2/conf/httpd.conf
2426
RUN echo "Include conf/extra/mediawiki.conf" >> /usr/local/apache2/conf/httpd.conf

0 commit comments

Comments
 (0)