Feature #665
server.errorlog is global instead of per virtual host
| Status: | Wontfix | Start: | ||
|---|---|---|---|---|
| Priority: | High | Due date: | ||
| Assigned to: | - | % Done: | 0% |
|
| Category: | core | |||
| Target version: | 1.4.22 | |||
| Missing in 1.5.x: |
Description
when defining a server.errorlog in some conditionals, the last server.errorlog instruction is taken has global :
server.errorlog = "/home/foo/logs/error.log"
$HTTPhost =~ "first.foo.com$" {
server.document-root = "/home/foo/first/"
server.errorlog = "/home/foo/logs/first.errorlog"
accesslog.filename = "/home/foo/logs/first.accesslog"
}
$HTTPhost =~ "second.foo.com$" {
server.document-root = "/home/foo/second/"
server.errorlog = "/home/foo/logs/second.errorlog"
accesslog.filename = "/home/foo/logs/second.accesslog"
}
=> error for all host are logged in /home/foo/logs/second.errorlog
-- oliv
History
Updated by Anonymous about 4 years ago
Can confirm the same bug on OpenBSD running lighttpd-1.4.11.
Last conditional gets the error logging, access logging appears to be working correctly.
-- anil
Updated by Anonymous almost 4 years ago
Also on FreeBSD 6.1 running lighttpd-1.4.11 (ssl)
-- lighttpd
Updated by Anonymous almost 4 years ago
Also on Debian sarge running lighttpd 1.4.12
-- dp
Updated by tcsoft almost 4 years ago
can confirm it for lighttpd-1.4.13 on Debian-Sarge too
Updated by darix almost 4 years ago
you know. your assumption is wrong. this is by design atm. this is only an enhancement request to make it conditional in the future.
just as a reminder.
Updated by Anonymous over 3 years ago
It took me an hour to find this ticket. Many of the Wiki examples pretend that the error file is to be set individually for each vhost.
Example: http://trac.lighttpd.net/trac/wiki/HowToSetupFastCgiIndividualPermissions
-- alex
Updated by Anonymous over 3 years ago
This bug is annoying if you try to do vhosting different customers.
Errors in their code should be going to their logfile.
-- Jan Scholten
Updated by Anonymous about 3 years ago
Also on Fedora 7 running lighttpd 1.4.16.
-- Aleksey Klimov
Updated by Anonymous almost 3 years ago
Also on lighttpd 1.4.18
Updated by Anonymous over 2 years ago
''"Bug opened 2 years_ ago."'' Oops!
Yep, virtual hosting needs this.
-- grin
Updated by Anonymous over 2 years ago
Centos5
lighttpd-1.4.18 (ssl)
Still the same problem.
It might even be affecting php-cgi when misconfigured in this way. I was having issues of pages not loading. Browser would connect to the server but nothing would load. If you refreshed a couple of times it would eventually load. Sometimes there would be stuck php-cgi processes that I had to kill manually.
After trying to debug some scripts I found that all my 3-4 sites were logging to the same file as described here. Once I removed the lines in the conditionals, everything started working OK. Not sure if it was a coincidence or not.
If that was relating to the issue, it could be a bit bigger than we think, due to a lot of documentation on the web explaining that this is the way to do it.
-- ShaunO
Updated by stbuehler over 2 years ago
This is not a bug - it just is.
As it is by design, i don't think this will ever get implemented.
You can start you fastcgi backends with custom scripts to pipe their errors into separate logs, so your customers can see their php errors.
And imho, server errors should be in a server-log, not in a vhost (and many errors may not even get to the point where the vhost is known).
Fixed the linked documentation.
Updated by dandv about 2 years ago
We may work around this limitation by messing with the fastcgi script outputs, but this is not the point.
Virtual hosts should be as independent of each other as possible. Each can have their own access log. Why not their own error log? Apache does this. Is it impossible for lighttpd to do it as well?
Updated by dandv about 2 years ago
Here are some arguments for separating error logs per vhost:
1. Virtual hosts are conceptually separated. This should be translated systematically and consistently into log separation. acceslog.filename is per vhost, so should be the errorlog.
2. One server admin may administer multiple web sites served by one lighty, the classic example being a 'stage' version of a site, and a 'prod' version. The same admin will want to treat the 'prod' errors with higher priority than the 'stage' errors, hence the need for separating them.
Please vote in this poll on whether lighttpd should separate error logs per virtual host, just like the access log, vs. amalgamating all errors into one server.errorlog.
Updated by stbuehler about 2 years ago
- Status changed from New to Fixed
- Resolution set to wontfix
- You have one lighttpd running, so one error.log. For your applications you should use extra error logs if you need separate ones.
- stage and prod running on in the same webserver instance? Just run a second lighttpd...
- The code isn't designed for this - too much work in 1.4 and 1.5
Updated by stbuehler almost 2 years ago
- Status changed from Fixed to Wontfix
Updated by dandv over 1 year ago
- Status changed from Wontfix to Reopened
Please consider implementing this feature. Nginx supports separating error logs per virtual host: http://article.gmane.org/gmane.comp.web.nginx.english/1628
Updated by stbuehler over 1 year ago
- Status changed from Reopened to Wontfix
- Patch available set to No
Updated by Dark over 1 year ago
- Status changed from Wontfix to Reopened
One more try to reopen this annoying "bug" =)
Updated by stbuehler over 1 year ago
- Status changed from Reopened to Wontfix
Updated by dandv over 1 year ago
I'm watching this issue and the e-mail notification about change #20 contained the following text:
One more stupid guy i don't care about.
What was that about, stbuehler?
Updated by slynko over 1 year ago
- Status changed from Wontfix to Reopened
- Target version changed from 1.5.0 to 1.4.22
I also vote for this feature
Updated by stbuehler over 1 year ago
- Status changed from Reopened to Wontfix
It's not about how many people want this or what other httpd servers are doing. I will not change the core in 1.4 for this ("stable" version). I probably won't have the time to review such a patch for 1.5 and sandbox already has this feature.
If you want a separate error log for the *cgi backends, just provide a patch.
PS: It is really annoying to close this bug twice a week... and that is time in which I could have done way better things for lighty...
Updated by mk over 1 year ago
This is unrelated to an actual fix in lighttpd but it may help some people until the fix appears.
A limited workaround for PHP is to early in your code do:
ini_set("error_log", "/path/to/your/own/error.log");
The file needs to be writeable by lighttpd of course (and dont forget to add it for log rotation if appropriate).
Also available in: Atom