How to write event log category

You can write an event log entry with a given category but you need to create an extra native dll with a String Resource table which is registered in the event log. This does complicate your deployment further. You currently have to do during installation

  1. To create new Event Log Sources you need to have admin rights every time you create a new source. It is therefore wise to collect all sources so you can install at once during the initial installation.
  2. Create a native dll which does contain a String Resource table for each category id you want to supply.
  3. Register the category dll in the registry to make Windows aware of it.

Now you can use the overload to write an event log message with a given category.

There is a very good Dr. Jobs Journal article describing exactly your problem.