1. Caddy version (caddy version):
v 2.4.6
2. How I run Caddy:
Webserver & reverse proxy manager on a VPS with multiple services hidden behind (served in part through a docker network, in part bare metal)
a. System environment:
Ubuntu 20.04
b. Command:
systemctl start/stop/reload/status caddy
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
(basic-auth) {
	basicauth / {
		user1 ########################################
		user2 ########################################
	}
}
## Check if a cookie token is set on the browser
(proxy-auth) {
	@no-auth {
		not header_regexp myid Cookie #######################
	}
	route @no-auth {
		header Set-Cookie "myreferer={scheme}://{host}{uri}; Domain=mfxm.fr; Path=/; Max-Age=30; HttpOnly; SameSite=Strict; Secure"
		redir https://auth-tools.mfxm.fr
	}
}
# Create CORS for StandardNotes extensions
(cors) {
	@origin header Origin {args.0}
	header @origin Access-Control-Allow-Origin "{args.0}"
}
(log) {
	log {
		output file /var/log/caddy/caddy.log {
			roll_local_time
		}
		format console
		level INFO
	}
}
{
	import log
}
# Pseudo site for authentication
## Sets the cookie in the browser
auth-tools.mfxm.fr {
	route / {
		import basic-auth
		header Set-Cookie "myid=##########################; Domain=mfxm.fr; Path=/; Max-Age=3600; HttpOnly; SameSite=Strict; Secure"
		header +Set-Cookie "myreferer=null; Domain=mfxm.fr; Path=/; Expires=Thu, 25 Sep 1971 12:00:00 GMT; HttpOnly; SameSite=Strict; Secure"
		redir {http.request.cookie.myreferer}
	}
	respond "Hi"
	import log
}
####.mfxm.fr {
	import proxy-auth
	encode zstp gzip
	reverse-proxy 17.27.37.14:80
        root * /var/www/html
# Enable the static file server.
        file_server
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
#        php_fastcgi unix//run/php/php7.4-fpm.sock
}
tools.mfxm.fr {
	# Set this path to your site's directory.
	header {
		Access-Control-Allow-Origin *
		Access-Control-Allow-Methods GET,POST,OPTIONS
		Access-Control-Allow-Headers DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Cont>
	}
	handle_path /####* {
		root * /home/####/public
		file_server
	}
	root * /var/www/html
	# Enable the static file server.
	file_server
	# serve a PHP site through php-fpm:
	php_fastcgi unix//run/php/php7.4-fpm.sock
	import log
}
3. The problem I’m having:
Despite the declaration of the log directive, nothing is written in my defined log file.
I have created the file with a sudo & file & path is chmod 666 for the caddy user to have rw rights.
4. Error messages and/or full log output:
systemctl status caddy.service
states that the log file is now being re-routed onto said file.
However, when i look into the file, it is empty:
5. What I already tried:
This worked until i wanted to changed the format from console to json and decided to delete the original file to recreate it (sudo rm && sudo touch) after which caddy did not write a single line back in.
Would you be able to let me know how to get Caddy to write in the file again?
Thanks in advance






