This happens using Lucee Express 5.3.9.166. It does not happen using 5.3.8.206.
Reproduction steps:
- Visit site1 (it will spin for ~10 seconds until it logs the error)
- Logs to site1/WEB-INF/lucee/logs/application.log (expected)
- Visit site 2 (it will spin for a second until it logs the error)
- Logs to site2/WEB-INF/lucee/logs/application.log (expected)
- Visit site1
- Logs to site2/WEB-INF/lucee/logs/application.log (UNEXPECTED)
- Visit site2
- Logs to site2/WEB-INF/lucee/logs/application.log (expected)
Subsequent errors on site1 are logged to site2. See log output at the end.
Configuration:
server.xml - added at end of file after default </Host>
:
<Host name="site1.localhost" appBase="webapps">
<Context path="" docBase="C:\tmp\site1" />
</Host>
<Host name="site2.localhost" appBase="webapps">
<Context path="" docBase="C:\tmp\site2" />
</Host>
site1/Application.cfc
component output="false" {
THIS.name = "site1";
this.tag.log.file="application"; // leads to logging on wrong site
this.tag.log.application="true";
public function onError(exception, event) {
writeLog(type="Information", text="site1 onError fired: Message:#exception.Message#");
writeOutput("Doh!");
}
}
site1/index.cfm
<cflog text="site1 hit #now()#">
<cfset foo = bar />
<cfoutput>
site1 hit #now()#
</cfoutput>
site2/Application.cfc
component output="false" {
THIS.name = "site2";
this.tag.log.file="application"; // leads to logging on wrong site
this.tag.log.application="true";
public function onError(exception, event) {
writeLog(type="Information", text="site2 onError fired: Message:#exception.Message#");
writeOutput("Doh!");
}
}
site2/index.cfm
<cflog text="site2 hit #now()#">
<cfset foo = bar />
<cfoutput>
site2 hit #now()#
</cfoutput>
site1 application.log
"Severity","ThreadID","Date","Time","Application","Message"
"INFO","http-nio-8888-exec-1","11/08/2022","14:49:07","site1","site1 hit {ts '2022-11-08 14:48:47'}"
"INFO","http-nio-8888-exec-1","11/08/2022","14:49:17","site1","site1 onError fired: Message:variable [BAR] doesn't exist"
site2 application.log
"Severity","ThreadID","Date","Time","Application","Message"
"INFO","http-nio-8888-exec-2","11/08/2022","14:49:42","site2","site2 hit {ts '2022-11-08 14:49:20'}"
"INFO","http-nio-8888-exec-2","11/08/2022","14:49:42","site2","site2 onError fired: Message:variable [BAR] doesn't exist"
"INFO","http-nio-8888-exec-3","11/08/2022","14:49:46","site1","site1 hit {ts '2022-11-08 14:49:46'}"
"INFO","http-nio-8888-exec-3","11/08/2022","14:49:46","site1","site1 onError fired: Message:variable [BAR] doesn't exist"
"INFO","http-nio-8888-exec-4","11/08/2022","14:49:49","site2","site2 hit {ts '2022-11-08 14:49:49'}"
"INFO","http-nio-8888-exec-4","11/08/2022","14:49:49","site2","site2 onError fired: Message:variable [BAR] doesn't exist"
"INFO","http-nio-8888-exec-5","11/08/2022","14:50:34","site1","site1 hit {ts '2022-11-08 14:50:34'}"
"INFO","http-nio-8888-exec-5","11/08/2022","14:50:34","site1","site1 onError fired: Message:variable [BAR] doesn't exist"