diff --git a/conf/bookwyrm-server.service b/conf/bookwyrm-server.service index 568143c..33d7ca7 100644 --- a/conf/bookwyrm-server.service +++ b/conf/bookwyrm-server.service @@ -9,7 +9,9 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ EnvironmentFile=__INSTALL_DIR__/.env -ExecStart=__INSTALL_DIR__/venv/bin/gunicorn bookwyrm.wsgi:application --bind 127.0.0.1:__PORT__ +ExecStart=__INSTALL_DIR__/venv/bin/gunicorn bookwyrm.wsgi:application --bind 127.0.0.1:__PORT__ --error-logfile /var/log/__APP__/__APP__.log +StandardOutput=append:/var/log/__APP__/__APP__.log +StandardError=inherit [Install] WantedBy=multi-user.target diff --git a/scripts/install b/scripts/install index b068190..229819d 100755 --- a/scripts/install +++ b/scripts/install @@ -58,6 +58,16 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=1 # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# LOGROTATE CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring logrotate..." --weight=1 + +# Use logrotate to manage application logfile(s) +ynh_use_logrotate --specific_user=$app +touch /var/log/$app/$app.log +chown -R $app:www-data /var/log/$app/ + #================================================= # SETUP SYSTEMD #=================================================