Skip to content

Commit

Permalink
Update CKAN config log file handler to use the worker log file and th…
Browse files Browse the repository at this point in the history
…e supervisor processes
  • Loading branch information
MarkCalvert committed Feb 28, 2024
1 parent d101e65 commit 967ca34
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ckan/Dockerfile.worker
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FROM ${CKAN_IMAGE}
# Override the default CKAN config plugins to only use the ones we need for the worker
ENV CKAN__PLUGINS="dbca activity datastore xloader scheming_datasets qa archiver report envvars"
RUN ckan config-tool $CKAN_INI "ckan.plugins = ${CKAN__PLUGINS}"
# Update the CKAN config log file handler to use the worker log file
RUN ckan config-tool $CKAN_INI -s handler_fileHandler "args = ('/srv/app/logs/ckan-worker.log', 'midnight', 1, 7)"

## Supervisor config
COPY supervisor/*.conf /etc/supervisord.d
Expand Down
2 changes: 1 addition & 1 deletion ckan/config/dbca.ini
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ formatter = generic

[handler_fileHandler]
class = handlers.TimedRotatingFileHandler
args = ('/srv/app/logs/ckan.log', 'midnight', 1, 0)
args = ('/srv/app/logs/ckan.log', 'midnight', 1, 7)
level = NOTSET
formatter = generic

Expand Down
1 change: 1 addition & 0 deletions ckan/docker-entrypoint.d/02_setup_dbca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Create logs folder/files and set permissions
mkdir -p $APP_DIR/logs
touch $APP_DIR/logs/ckan.log
touch $APP_DIR/logs/ckan-worker.log
chown -R ckan:ckan $APP_DIR/logs

## Create archive folder and set permissions
Expand Down
2 changes: 1 addition & 1 deletion ckan/supervisor/ckan_cron_jobs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process_name=%(program_name)s-%(process_num)02d


; Log files.
stderr_logfile=/srv/app/logs/ckan.log
stderr_logfile=/srv/app/logs/ckan-worker.log


; Make sure that the worker is started on system start and automatically
Expand Down
2 changes: 1 addition & 1 deletion ckan/supervisor/ckan_worker_bulk.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process_name=%(program_name)s-%(process_num)02d


; Log files.
stderr_logfile=/srv/app/logs/ckan.log
stderr_logfile=/srv/app/logs/ckan-worker.log


; Make sure that the worker is started on system start and automatically
Expand Down
2 changes: 1 addition & 1 deletion ckan/supervisor/ckan_worker_default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process_name=%(program_name)s-%(process_num)02d


; Log files.
stderr_logfile=/srv/app/logs/ckan.log
stderr_logfile=/srv/app/logs/ckan-worker.log


; Make sure that the worker is started on system start and automatically
Expand Down
2 changes: 1 addition & 1 deletion ckan/supervisor/ckan_worker_priority.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process_name=%(program_name)s-%(process_num)02d


; Log files.
stderr_logfile=/srv/app/logs/ckan.log
stderr_logfile=/srv/app/logs/ckan-worker.log


; Make sure that the worker is started on system start and automatically
Expand Down

0 comments on commit 967ca34

Please sign in to comment.