Here is a code snippet for writing information to the EventLog. This code will work in a BizTalk Expression Shape as well as in a .NET application.

if (!System.Diagnostics.EventLog.SourceExists("BizTalkDev.Assembly.Namespace"))
{
  System.Diagnostics.EventLog.CreateEventSource("BizTalkDev.Assembly.Namespace", "Application");
}
System.Diagnostics.EventLog.WriteEntry("BizTalkDev.Assembly.Namespace", "Error Message Here", System.Diagnostics.EventLogEntryType.Error);

Instead of writing to the "Application" folder, you might consider using your own folder (replace "Application" with "MyEventLogFolderName") so it will be easier to find your Events.

If you get an EventLog access error, see this post for the correct registry setting.