unit: application logging to files not working for php wordpress

even though we setup as in doc: https://unit.nginx.org/news/2023/unit-1.30.0-released/#application-logging

still php error log goes to main unit.log file

"testsite": {
		"stderr": "/tmp/unit_app.log",
		"stdout": "/tmp/unit_app_error.log",
		"user": "unit",
		"type": "php 7.4",
		"targets": {
			"direct": {
				"root": "/sites/site/"
			},

			"index": {
				"root": "/sites/site/",
				"script": "index.php"
			}
		}
	}

thanks

# unitd --version
unit version: 1.30.0
configured as ./configure --prefix=/usr --statedir=/var/lib/unit --control=unix:/var/run/unit/control.sock --pid=/var/run/unit/unit.pid --log=/var/log/unit/unit.log --tmpdir=/var/tmp --user=unit --group=unit --tests --openssl --njs --modulesdir=/usr/lib64/unit/modules --libdir=/usr/lib64 --cc-opt='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC' --ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

@sidz yes please do. I am happy to link it to this issue but we should open another one to work on the per application logging OR better to say application logging in Docker using Unit.

There are some fundamental differences between the no-daemon and daemon mode. Will use the new issue to elaborate on those and share potential work arounds and solutions