Let us imagine that we are interested in situations when electricity has turned off and the UPS began to work in battery mode (ID Code = 2000), and after a time electrical supply was restored (ID Code = 1003).
You should also remember that after utility power is restored, the UPS does not always generate the Utility Power Restored event; sometimes, it generates the UPS Enabling SmartBoost or UPS Enabling SmartTrim events. In order to not "miss" the moment at which utility power is restored, it is advisable to also handle the UPS Enabling SmartBoost and UPS Enabling SmartTrim events.
Each time the StateUPS utility is called, a log file is created in the OS system folder (System32) with a name of the following format:
upslog_<state><date><time>.log