Skip to content

Commit b3726d0

Browse files
committed
(feat): uid per request on logs
1 parent 97be759 commit b3726d0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends wget vim superv
2727
sudo zlib1g zlib1g-dev libzip4 libzip-dev zip unzip librabbitmq-dev && \
2828
rm -rf /var/lib/apt/lists/*
2929

30-
RUN a2enmod rewrite
30+
RUN a2enmod rewrite unique_id
3131

3232
RUN docker-php-ext-configure gd --with-jpeg \
3333
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
@@ -76,6 +76,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/
7676
mkdir /var/www/.composer && chown -R www-data:www-data /var/www/.composer
7777

7878
COPY configs/ports.conf /etc/apache2/ports.conf
79+
COPY configs/logs.conf /etc/apache2/conf-enabled/logs.conf
7980
COPY apache-run.sh /usr/bin/apache-run
8081

8182
RUN chmod a+x /usr/bin/apache-run

configs/logs.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ErrorLogFormat "[uid:%{UNIQUE_ID}e] %a [x-client-ip:%{X-Client-IP}i] [%{cu}t] \"%{REQUEST_METHOD}e %{REQUEST_URI}e\" %M"
2+
LogFormat "[uid:%{UNIQUE_ID}e] %a [x-client-ip:%{X-Client-IP}i] [%{%Y-%m-%d %H:%M:%S}t] \"%r\" %>s %b, referer: \"%{Referer}i\", user-agent: \"%{User-agent}i\"" vhost_combined
3+
LogFormat "[uid:%{UNIQUE_ID}e] %a [x-client-ip:%{X-Client-IP}i] [%{%Y-%m-%d %H:%M:%S}t] \"%r\" %>s %b, referer: \"%{Referer}i\", user-agent: \"%{User-agent}i\"" combined
4+
5+
LogLevel warn
6+
7+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

0 commit comments

Comments
 (0)