Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
9142acf6
Commit
9142acf6
authored
May 11, 2013
by
Joe Blaylock
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #57 from edx/feature/jrbl/logging_rotation
Configure logrotate to treat edx logs appropriately
parents
ca055b6e
00f7ad7a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
101 additions
and
9 deletions
+101
-9
playbooks/roles/cms/tasks/main.yml
+3
-0
playbooks/roles/common/tasks/edx_logging_base.yml
+26
-0
playbooks/roles/common/tasks/main.yml
+10
-3
playbooks/roles/common/tasks/rsyslog.yml
+0
-6
playbooks/roles/common/templates/edx_logrotate.j2
+12
-0
playbooks/roles/common/templates/edx_logrotate_tracking_log.j2
+11
-0
playbooks/roles/lms/tasks/main.yml
+3
-0
playbooks/roles/nginx/tasks/main.yml
+14
-0
playbooks/roles/nginx/templates/edx_logrotate_nginx_access.j2
+11
-0
playbooks/roles/nginx/templates/edx_logrotate_nginx_error.j2
+11
-0
No files found.
playbooks/roles/cms/tasks/main.yml
View file @
9142acf6
...
...
@@ -26,5 +26,8 @@
-
cms-env
-
logging
# If we set up CMS, we have to set up edx logging
-
include
:
../../common/tasks/edx_logging_base.yml
# Creates LMS upstart file
-
include
:
../../gunicorn/tasks/upstart.yml service_variant=cms
playbooks/roles/common/tasks/edx_logging_base.yml
0 → 100644
View file @
9142acf6
---
-
name
:
Install rsyslog configuration for edX
template
:
dest=/etc/rsyslog.d/99-edx.conf src=edx_rsyslog.j2 owner=root group=root mode=644
notify
:
restart rsyslogd
tags
:
-
logging
-
name
:
Install logrotate configuration for edX
template
:
dest=/etc/logrotate.d/edx-services src=edx_logrotate.j2 owner=root group=root mode=644
tags
:
-
logging
-
name
:
Touch tracking file into existence
command
:
touch -a {{log_base_dir}}/tracking.log creates={{log_base_dir}}/tracking.log
tags
:
-
logging
-
name
:
Set permissions on tracking file
file
:
path={{log_base_dir}}/tracking.log owner=syslog group=adm mode=750
tags
:
-
logging
-
name
:
Install logrotate configuration for tracking file
template
:
dest=/etc/logrotate.d/tracking.log src=edx_logrotate_tracking_log.j2 owner=root group=root mode=644
tags
:
-
logging
playbooks/roles/common/tasks/main.yml
View file @
9142acf6
...
...
@@ -22,6 +22,7 @@
with_items
:
-
ack-grep
-
lynx-cur
-
logrotate
-
mosh
-
rsyslog
-
screen
...
...
@@ -34,15 +35,21 @@
tags
:
-
pre_install
-
name
:
Create alias
es to the log directory
-
name
:
Create alias
from app_base_dir to the log_base_dir
file
:
state=link src=$log_base_dir path=$app_base_dir/log
tags
:
-
pre_install
-
logging
-
name
:
Create convenience link from log_base_dir to system logs
file
:
state=link src=/var/log path=$log_base_dir/system
tags
:
-
pre_install
-
logging
-
name
:
Touch edx log file into place
# This is done for the benefit of the rake commands, which expect it
command
:
touch -a {{log_base_dir}}/edx.log
command
:
touch -a {{log_base_dir}}/edx.log
creates={{log_base_dir}}/edx.log
tags
:
-
pre_install
-
logging
...
...
@@ -55,6 +62,6 @@
-
logging
-
include
:
create_venv.yml
-
include
:
rsyslog
.yml
-
include
:
edx_logging_base
.yml
-
include
:
software_update.yml
playbooks/roles/common/tasks/rsyslog.yml
deleted
100644 → 0
View file @
ca055b6e
---
-
name
:
Install rsyslog configuration for edX
template
:
dest=/etc/rsyslog.d/99-edx src=edx_rsyslog.j2 owner=root group=root mode=644
notify
:
restart rsyslogd
tags
:
-
logging
playbooks/roles/common/templates/edx_logrotate.j2
0 → 100644
View file @
9142acf6
{{log_base_dir}}/*/edx.log {
create
compress
copytruncate
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
playbooks/roles/common/templates/edx_logrotate_tracking_log.j2
0 → 100644
View file @
9142acf6
{{log_base_dir}}/tracking.log {
create
compress
delaycompress
dateext
missingok
notifempty
daily
rotate 365000
size 1M
}
playbooks/roles/lms/tasks/main.yml
View file @
9142acf6
...
...
@@ -32,6 +32,9 @@
-
lms-env
-
logging
# If we set up LMS, we have to set up edx logging
-
include
:
../../common/tasks/edx_logging_base.yml
# Install ssh keys for ubuntu account to be able to check out from mitx
# Temprory behavior, not needed after June 1. Perhaps still useful as a recipe.
# {{ secure_dir }} is relative to the top-level playbooks dir so there is some
...
...
playbooks/roles/nginx/tasks/main.yml
View file @
9142acf6
...
...
@@ -29,8 +29,22 @@
service
:
name=nginx state=started
tags
:
-
nginx
-
name
:
Create nginx log file location (just in case)
file
:
path={{log_base_dir}}/nginx state=directory owner=syslog group=adm mode=2770
tags
:
-
nginx
-
logging
# Commented out until default config has nginx log to {{log_base_dir}}/nginx
# and also until default logrotate task 'nginx' gets removed
###
#- name: Set up nginx access log rotation
# template: dest=/etc/logrotate.d/nginx-access src=edx_logrotate_nginx_access.j2 owner=root group=root mode=644
# tags:
# - logging
#
#- name: Set up nginx access log rotation
# template: dest=/etc/logrotate.d/nginx-error src=edx_logrotate_nginx_error.j2 owner=root group=root mode=644
# tags:
# - logging
playbooks/roles/nginx/templates/edx_logrotate_nginx_access.j2
0 → 100644
View file @
9142acf6
{{log_base_dir}}/nginx/access.log {
create
compress
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
playbooks/roles/nginx/templates/edx_logrotate_nginx_error.j2
0 → 100644
View file @
9142acf6
{{log_base_dir}}/nginx/error.log {
create
compress
delaycompress
dateext
missingok
notifempty
daily
rotate 90
size 1M
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment