Furqan Sehgal
Furqan Sehgal

Reputation: 4997

Application should give Indication while shut down

I need to set my application to save entry (e.g LoggedOff) to database if application shuts down abnormally, like power failure or anything else like that.

What event should be fired to achieve this?

Thanks Furqan

Upvotes: 0

Views: 58

Answers (2)

Shadow Wizard
Shadow Wizard

Reputation: 66389

The only way you can save such entry is by having external "monitor" on the web server that ping it on regular intervals (e.g. every 20 seconds) and if the web server does not respond flag it as down until it respond again.

That monitor can be for example windows service installed on different machine, or on some machines in case one goes down as well.

Upvotes: 1

Oded
Oded

Reputation: 499002

If power have gone off, no events can be fired.

Upvotes: 2

Related Questions