Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Service logging PowerEvent 1

Status
Not open for further replies.

adamroof

Programmer
Nov 5, 2003
1,107
US
Hi,

I have a standard scheduling service built from VS2008 and my actions are working ok, however my app event log keeps logging "PowerEvent handled successfully by the service" from 30 seconds to 8 minutes apart at random. The service schedule is coded to only execute tasks every 15 minutes.

The service is running on my desktop PC (HP XW4400).

1. Can i override the OnPowerEvent to NOT log this event?
2. Is there a PC Power config i should modify?

My power scheme is Home/Office Desk
- Monitor : 20 mins
- Hard Disks: Never
- Standby: Never

I do have a UPS that isnt quite working (Belkin) and shows a 69% Charging status (never actually charges). Belkin Bulldog service is installed, could that be the reason this is logging? (i ordered a new UPS and is on its way)

Thanks for any input.
 
You should be able to customize logging by using the members
CanHandlePowerEvent
AutoLog
OnStart/Pause/Stop/etc members.

so if you want the service to handle power events along with automatic logging for starting and stopping but not pausing, set AutoLog=false and override OnStart and OnStop to EventLot.Write(...).

if your service doesn't need to handle power events set CanHandlePowerEvent=false and AutoLog=true

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top