public boolean function onApplicationStart()
{
writeLog (text="Application #this.name# started!!!", file="application", type="Debug", application="no");
return true;
}
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/c327b50e-53db-4959-b819-a40207ac407e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
public boolean function onRequestStart()
{
//Lucee 5 is not firing onApplicationStart on first request so we need to check if the application has been initialized
if (not isDefined('application.beanFactory'))
{
applicationStop();
return true;
}
}
i just did a testcase based on your input , i have the test make a little bit clearer.component {this.name=createUUID();public boolean function onApplicationStart() {throw "start";return true;}}to be sure i have a new application context with every request i change the name (red) with every request and then i throw an exception (blue), because writing to the log can have a delay (for performance reasons).this works as expected for me.to be honest it is unlikely that the onApplicationStart does not work in that way, this would break every second application out there.i will add a testcase that checks if onApplicationStart and onApplicationStart get invoked correctly.Micha
On Wed, Aug 10, 2016 at 6:40 PM, Phil Cruz <ph...@philcruz.com> wrote:
I'm migrating an app from ACF to Lucee 5 on Windows. I was hitting some errors where some application variables I was trying to reference where not being defined. I tracked it down and it seems that onApplicationStart() was not firing. I simplified the function to
public boolean function onApplicationStart()
{
writeLog (text="Application #this.name# started!!!", file="application", type="Debug", application="no");
return true;
}When I restart the Lucee server and make the first request I don't get an entry in the log file. I'm looking in the correct log and I can see other log statements written there.If I hit a page that calls applicationStop(), then on the next request onApplicationStart() is called and I see the log entry. But why would it not be called on the very first request?
--
Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b47feb2c-9589-472b-baf9-8fa8302a5330%40googlegroups.com.
component output="false"{
this.name = "myapp";
this.ormenabled = false;
this.ormsettings = {
datasource="mydsn",
cfclocation="/components",
eventHandling = true,
automanageSession = false,
flushatrequestend = false,
logsql = false,
dialect= "MicrosoftSQLServer"
};
public void function onRequest(required string TargetPage)
{
include arguments.targetPage;
return;
}
public boolean function onApplicationStart()
{
writeLog (text="Application started...", file="application", type="Debug", application="no");
application.foo = "bar";
return true;
}
}
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/0467132d-4cec-42eb-a1d2-f9572712707a%40googlegroups.com.