Wednesday, April 29, 2009

Strange design of EventLog

Everyone knows EventLog of Windows – you see different event logs and you can see different events in each of them.

For each Event, you can see some information – event type (warning, information…), date and time, source (that is used to see where that event comes from), event id and category…

Well, pretty simple and clear. However what if you are developer?

For my project I wanted to use event log to write entries. Multiple servers are processed and based on event log you can for example see that server x failed – and in description you see why it happened…

S4Matic supports multiple jobs – so for example now I got job for server reboot, server rebuild and emergency update. I wanted to have event logs automatically generated for this, so you could easily see events from separate jobs…

And then I run into problem – you can use source ONLY in one event log. So if you FIRST time use source Security in Security event log, you CANNOT use it in any other event log.

Error occured while processing job Get Citrix servers.
The source 'GEN-Scheduler' is not registered in log 'S4Matic RegularJobs'. (It is registered in log 'S4Matic'.) " The Source and Log properties must be matched, or you may set Log to the empty string, and it will automatically be matched to the Source property.
Script D:\S4Matic\Engine\Runtime\CoreFunctions.ps1, line 28.

Once you FIRST time use “Server1” (server name) in ANY event log, you are not allowed to use it in any other event log.

This is especially annoying with Windows Vista or newer OSs – you got multiple event logs (and therefore I would expect Microsoft would like to see vendors using their own event logs), however with this limitation you run into big risk of conflicts between different event logs. You should use your application name as event source, however then you loose flexibility to use per-application event log (I already know that specific event log is used by my application).

Am I the only one that finds this very annoying??

No comments: