Route all of the logging through syslog-ng. Add the ability to specify extra syslog-ng config. Simplify the Dockerfile.
This commit is contained in:
parent
b1537a01aa
commit
24cf27bd12
32 changed files with 32 additions and 46 deletions
14
Dockerfile
14
Dockerfile
|
@ -38,19 +38,13 @@ ADD . .
|
||||||
# Run grunt
|
# Run grunt
|
||||||
RUN cd grunt && grunt
|
RUN cd grunt && grunt
|
||||||
|
|
||||||
ADD conf/init/svlogd_config /svlogd_config
|
|
||||||
ADD conf/init/doupdatelimits.sh /etc/my_init.d/
|
ADD conf/init/doupdatelimits.sh /etc/my_init.d/
|
||||||
ADD conf/init/preplogsdir.sh /etc/my_init.d/
|
ADD conf/init/copy_syslog_config.sh /etc/my_init.d/
|
||||||
ADD conf/init/runmigration.sh /etc/my_init.d/
|
ADD conf/init/runmigration.sh /etc/my_init.d/
|
||||||
|
|
||||||
ADD conf/init/gunicorn_web /etc/service/gunicorn_web
|
ADD conf/init/service/ /etc/service/
|
||||||
ADD conf/init/gunicorn_registry /etc/service/gunicorn_registry
|
|
||||||
ADD conf/init/gunicorn_verbs /etc/service/gunicorn_verbs
|
RUN rm -rf /etc/service/syslog-forwarder
|
||||||
ADD conf/init/nginx /etc/service/nginx
|
|
||||||
ADD conf/init/diffsworker /etc/service/diffsworker
|
|
||||||
ADD conf/init/notificationworker /etc/service/notificationworker
|
|
||||||
ADD conf/init/buildlogsarchiver /etc/service/buildlogsarchiver
|
|
||||||
ADD conf/init/buildmanager /etc/service/buildmanager
|
|
||||||
|
|
||||||
# Download any external libs.
|
# Download any external libs.
|
||||||
RUN mkdir static/fonts static/ldn
|
RUN mkdir static/fonts static/ldn
|
||||||
|
|
|
@ -4,7 +4,7 @@ types_hash_max_size 2048;
|
||||||
include /usr/local/nginx/conf/mime.types.default;
|
include /usr/local/nginx/conf/mime.types.default;
|
||||||
|
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
access_log /var/log/nginx/nginx.access.log;
|
access_log /dev/stdout;
|
||||||
sendfile on;
|
sendfile on;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/buildlogsarchiver/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/buildmanager/
|
|
6
conf/init/copy_syslog_config.sh
Executable file
6
conf/init/copy_syslog_config.sh
Executable file
|
@ -0,0 +1,6 @@
|
||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
if [ -e /conf/stack/syslog-ng-extra.conf ]
|
||||||
|
then
|
||||||
|
cp /conf/stack/syslog-ng-extra.conf /etc/syslog-ng/conf.d/
|
||||||
|
fi
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/diffsworker/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/gunicorn_registry/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/gunicorn_verbs/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/gunicorn_web/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd /var/log/nginx/
|
|
|
@ -1,2 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
exec svlogd -t /var/log/notificationworker/
|
|
|
@ -1,10 +0,0 @@
|
||||||
#! /bin/sh
|
|
||||||
|
|
||||||
echo 'Linking config files to logs directory'
|
|
||||||
for svc in `ls /etc/service/`
|
|
||||||
do
|
|
||||||
if [ ! -d /var/log/$svc ]; then
|
|
||||||
mkdir -p /var/log/$svc
|
|
||||||
ln -s /svlogd_config /var/log/$svc/config
|
|
||||||
fi
|
|
||||||
done
|
|
2
conf/init/service/buildlogsarchiver/log/run
Executable file
2
conf/init/service/buildlogsarchiver/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t buildlogsarchiver
|
2
conf/init/service/buildmanager/log/run
Executable file
2
conf/init/service/buildmanager/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t buildmanager
|
2
conf/init/service/diffsworker/log/run
Executable file
2
conf/init/service/diffsworker/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t diffsworker
|
2
conf/init/service/gunicorn_registry/log/run
Executable file
2
conf/init/service/gunicorn_registry/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t gunicorn_registry
|
2
conf/init/service/gunicorn_verbs/log/run
Executable file
2
conf/init/service/gunicorn_verbs/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t gunicorn_verbs
|
2
conf/init/service/gunicorn_web/log/run
Executable file
2
conf/init/service/gunicorn_web/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t gunicorn_web
|
2
conf/init/service/nginx/log/run
Executable file
2
conf/init/service/nginx/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t nginx
|
2
conf/init/service/notificationworker/log/run
Executable file
2
conf/init/service/notificationworker/log/run
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/sh
|
||||||
|
exec logger -i -t notificationworker
|
|
@ -1,3 +0,0 @@
|
||||||
s100000000
|
|
||||||
t86400
|
|
||||||
n4
|
|
|
@ -5,4 +5,4 @@ real_ip_header proxy_protocol;
|
||||||
log_format elb_pp '$proxy_protocol_addr - $remote_user [$time_local] '
|
log_format elb_pp '$proxy_protocol_addr - $remote_user [$time_local] '
|
||||||
'"$request" $status $body_bytes_sent '
|
'"$request" $status $body_bytes_sent '
|
||||||
'"$http_referer" "$http_user_agent"';
|
'"$http_referer" "$http_user_agent"';
|
||||||
access_log /var/log/nginx/nginx.access.log elb_pp;
|
access_log /dev/stdout elb_pp;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# vim: ft=nginx
|
# vim: ft=nginx
|
||||||
|
|
||||||
pid /tmp/nginx.pid;
|
pid /tmp/nginx.pid;
|
||||||
error_log /var/log/nginx/nginx.error.log;
|
error_log /dev/stdout;
|
||||||
|
|
||||||
worker_processes 2;
|
worker_processes 2;
|
||||||
worker_priority -10;
|
worker_priority -10;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# vim: ft=nginx
|
# vim: ft=nginx
|
||||||
|
|
||||||
client_body_temp_path /var/log/nginx/client_body 1 2;
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
keepalive_timeout 5;
|
keepalive_timeout 5;
|
||||||
|
@ -36,7 +35,7 @@ location /v1/repositories/ {
|
||||||
|
|
||||||
proxy_pass http://registry_app_server;
|
proxy_pass http://registry_app_server;
|
||||||
proxy_read_timeout 2000;
|
proxy_read_timeout 2000;
|
||||||
proxy_temp_path /var/log/nginx/proxy_temp 1 2;
|
proxy_temp_path /tmp 1 2;
|
||||||
|
|
||||||
limit_req zone=repositories burst=10;
|
limit_req zone=repositories burst=10;
|
||||||
}
|
}
|
||||||
|
@ -47,7 +46,7 @@ location /v1/ {
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
|
|
||||||
proxy_pass http://registry_app_server;
|
proxy_pass http://registry_app_server;
|
||||||
proxy_temp_path /var/log/nginx/proxy_temp 1 2;
|
proxy_temp_path /tmp 1 2;
|
||||||
|
|
||||||
client_max_body_size 20G;
|
client_max_body_size 20G;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +57,7 @@ location /c1/ {
|
||||||
proxy_request_buffering off;
|
proxy_request_buffering off;
|
||||||
|
|
||||||
proxy_pass http://verbs_app_server;
|
proxy_pass http://verbs_app_server;
|
||||||
proxy_temp_path /var/log/nginx/proxy_temp 1 2;
|
proxy_temp_path /tmp 1 2;
|
||||||
|
|
||||||
limit_req zone=verbs burst=10;
|
limit_req zone=verbs burst=10;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue