handle new gitaly logs correctly

This commit is contained in:
Aurélien Chrétien 2020-05-06 12:20:47 +02:00
parent ef7729373b
commit f377eda47a
No known key found for this signature in database
GPG Key ID: 36D23B5324A78B7B
4 changed files with 20 additions and 3 deletions

View File

@ -8,7 +8,7 @@ ENV GITLAB_VERSION=${VERSION} \
GITLAB_SHELL_VERSION=12.2.0 \
GITLAB_WORKHORSE_VERSION=8.25.2 \
GITLAB_PAGES_VERSION=1.17.0 \
GITALY_SERVER_VERSION=12.10.0 \
GITALY_SERVER_VERSION=12.10.4 \
GITLAB_USER="git" \
GITLAB_HOME="/home/git" \
GITLAB_LOG_DIR="/var/log/gitlab" \

View File

@ -266,6 +266,19 @@ ${GITLAB_LOG_DIR}/gitlab-shell/*.log {
}
EOF
# configure gitlab log rotation
cat > /etc/logrotate.d/gitaly <<EOF
${GITLAB_LOG_DIR}/gitaly/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
copytruncate
}
EOF
# configure gitlab vhost log rotation
cat > /etc/logrotate.d/gitlab-nginx <<EOF
${GITLAB_LOG_DIR}/nginx/*.log {

View File

@ -45,9 +45,9 @@ path = "{{GITLAB_REPOS_DIR}}"
#
# # You can optionally configure Gitaly to output JSON-formatted log messages to stdout
# [logging]
[logging]
# # The directory where Gitaly stores extra log files
dir = "{{GITLAB_LOG_DIR}}"
dir = "{{GITLAB_LOG_DIR}}/gitaly"
# format = "json"
# # Optional: Set log level to only log entries with that severity or above
# # One of, in order: debug, info, warn, errror, fatal, panic

View File

@ -1347,6 +1347,10 @@ initialize_logdir() {
mkdir -p ${GITLAB_LOG_DIR}/gitlab-shell
chmod -R 0755 ${GITLAB_LOG_DIR}/gitlab-shell
chown -R ${GITLAB_USER}: ${GITLAB_LOG_DIR}/gitlab-shell
mkdir -p ${GITLAB_LOG_DIR}/gitaly
chmod -R 0755 ${GITLAB_LOG_DIR}/gitaly
chown -R ${GITLAB_USER}: ${GITLAB_LOG_DIR}/gitaly
}
initialize_datadir() {