Conversation
|
I believe there is no elegant way to create the logfile with the docker image.
For using Docker usually users would mount the log file and if so, the logfile needs to exist anyway. @mfxa, @nupplaphil: do you agree? |
|
For some reason i can't make a direct comment on your new "comment", so responding here instead:
I think it sounds like a better idea to create it in the Dockerfile, yes. Good idea. |
|
I will change the approach to what seems to be a good practice and
This would allow to read the log with the Docker log handling by default. It is still possible to mount a file to /var/log/friendica.log or a folder to /var/log/. And existing installations should not be affected (if their config is stored in the database). |
7be2bdc to
2be33fb
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #15001 where Friendica does not create its log file when logging is enabled. The solution changes the default log file location from /var/www/html/friendica.log to /var/log/friendica.log and creates a symbolic link to /dev/stdout, following Docker logging best practices.
Changes:
- Updated default logfile path from
/var/www/html/friendica.logto/var/log/friendica.login all Docker configuration files - Added symlink creation from
/var/log/friendica.logto/dev/stdoutin all Dockerfiles to redirect logs to Docker's logging system - Applied changes consistently across all variants (apache, fpm, fpm-alpine) and versions (2024.12, 2026.01, 2026.04-dev)
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| Dockerfile-debian.template | Template file: Added symlink creation for Debian-based variants |
| Dockerfile-alpine.template | Template file: Added symlink creation for Alpine-based variants |
| .config/zz-docker.config.php | Template config: Changed logfile path to /var/log/friendica.log |
| 2026.04-dev/fpm/Dockerfile | Development FPM variant: Added symlink to stdout |
| 2026.04-dev/fpm/config/zz-docker.config.php | Development FPM config: Updated logfile path |
| 2026.04-dev/fpm-alpine/Dockerfile | Development FPM Alpine variant: Added symlink to stdout |
| 2026.04-dev/fpm-alpine/config/zz-docker.config.php | Development FPM Alpine config: Updated logfile path |
| 2026.04-dev/apache/Dockerfile | Development Apache variant: Added symlink to stdout |
| 2026.04-dev/apache/config/zz-docker.config.php | Development Apache config: Updated logfile path |
| 2026.01/fpm/Dockerfile | Release 2026.01 FPM variant: Added symlink to stdout |
| 2026.01/fpm/config/zz-docker.config.php | Release 2026.01 FPM config: Updated logfile path |
| 2026.01/fpm-alpine/Dockerfile | Release 2026.01 FPM Alpine variant: Added symlink to stdout |
| 2026.01/fpm-alpine/config/zz-docker.config.php | Release 2026.01 FPM Alpine config: Updated logfile path |
| 2026.01/apache/Dockerfile | Release 2026.01 Apache variant: Added symlink to stdout |
| 2026.01/apache/config/zz-docker.config.php | Release 2026.01 Apache config: Updated logfile path |
| 2024.12/fpm/Dockerfile | Release 2024.12 FPM variant: Added symlink to stdout |
| 2024.12/fpm/config/zz-docker.config.php | Release 2024.12 FPM config: Updated logfile path |
| 2024.12/fpm-alpine/Dockerfile | Release 2024.12 FPM Alpine variant: Added symlink to stdout |
| 2024.12/fpm-alpine/config/zz-docker.config.php | Release 2024.12 FPM Alpine config: Updated logfile path |
| 2024.12/apache/Dockerfile | Release 2024.12 Apache variant: Added symlink to stdout |
| 2024.12/apache/config/zz-docker.config.php | Release 2024.12 Apache config: Updated logfile path |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Why not setting to syslog so there won't be a logfile? There's a env for switching it |
|
Actually it is best practice. It is not recommended to log to syslog, journal or a log file inside the container as this log would be gone when the container is stopped. |
|
I see, maybe some kind of doc but the rest seems fine |
This PR is opened as draft pull request as it may need some discussion and a bit more testing.
As described in #friendica/friendica#15001 the log file is not creatd by friendica when logging is enabled. This PR is an attempt to fix this.
I only had time to test this with the fpm image (which is debian based).
My concerns are: