WriteEntry to Event Log Fails



I am creating an EventLog and attempting to write to it using the
following code. The problem is when I inspect the log there in no
entry? Can anyone see what I am doing wrong here?


if (!System.Diagnostics.EventLog.SourceExists("SmartMI"))
{
System.Diagnostics.EventLog.CreateEventSource(
"SmartMI", "SmartMILog");
}



EventLog EventLog1 = new
EventLog("SmartMILog",System.Environment.MachineName, "SmartMI");

string msg = "Foo Bar";

EventLog1.WriteEntry(msg);

.