1. The problem I’m having:
I want to store logs in a different folder than default. So I have this simple test:
http://localhost {
root /srv/http
file_server
log {
output file /var/log/caddy/localhost.access.log
}
}
This works fine. Log file is created in the stated (default) location:
LANG=C sudo ls -al /var/log/caddy
total 12
drwxr-x--- 2 caddy caddy 4096 Aug 29 13:53 .
drwxr-xr-x 19 root root 4096 Aug 29 13:49 ..
-rw------- 1 caddy caddy 0 Aug 29 13:53 localhost.access.log
I create another log folder. Directory is owned by Caddy itself and has the same permissions than original log folder:
> LANG=C sudo ls -al /var/log/other
total 12
drwxr-x--- 2 caddy caddy 4096 Aug 29 13:30 .
drwxr-xr-x 19 root root 4096 Aug 29 13:49 ..
I change the location of the log file to the new location (just caddy → other):
...
output file /var/log/other/localhost.access.log
...
But now Caddy refuses to start giving a “read only filesystem” error (error bellow).
Is this a bug? If not I don’t see what I can be doing wrong (and being me it could be very silly, for sure …
)
2. Error messages and/or full log output:
Error: setting up custom log 'log0': opening log writer using &logging.FileWriter{Filename:"/var/log/other/localhost.access.log", Mode:0x0, Roll:(*bool)(nil), RollSizeMB:0, RollCompress:(*bool)(nil), RollLocalTime:false, RollKeep:0, RollKeepDays:0}: open /var/log/other/localhost.access.log: read-only file system
3. Caddy version:
Caddy v2.10.0
4. How I installed and ran Caddy:
a. System environment:
Up to date Manjaro (Arch based).
b. Command:
Caddy is run as a systemd service