onApplicationEnd

Defined in Application.cfc, invoked when the application times out or when the server is shutting down.

function onApplicationEnd(applicationScope) { } → returns boolean

Argument Reference

ApplicationScope struct
Required

The application scope of the application that is ending.

Examples
Sample code invoking the onApplicationEnd function

Write to the log that application has ended. In the example below, text 'myApp ended on {current date/time}' gets added to D:\CF\logs\myApp.log file. Note: Application has already ended, but we can use ApplicationScope argument to access any Application scope variables.

public void function onApplicationEnd(struct ApplicationScope){

		writeLog(text = "#arguments.ApplicationScope.name# ended on: #now()#");
		return true;
	}

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub