Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The EventLogWebEventProvider provider failed to log an event with the error code 0x80070057

I am writing WebEvent in my asp.net Application and it is working fine in both my development and production region.However, When I analyze Event Logs in production server for past couple of months.I see below event

 The following exception was thrown by the web event provider 'EventLogProvider' in   the application '/(MyApplicationName)' (in an application lifetime a maximum of one exception will be logged per provider instance):

System.Web.HttpException (0x80004005): The EventLogWebEventProvider provider failed to log an event with the error code 0x80070057.

at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)

at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)

Although Occurrence is very low, still I am curious to understand why this is happening.I tried to do some research and found below link http://forums.iis.net/t/1201176.aspx?IIS+Keep+hanging

According to this link, I may be passing some invalid argument while writing event log. But I double checked my EventLog.WriteEntry method and I am using it in my application only in couple of places and moreover, I am passing static string message. If argument is invalid then it should occur every time I try to write event.

Can anyone please help me understanding possible cause for this event.is there any known issue when working with EvenLog?

like image 702
Viru Avatar asked Nov 11 '22 09:11

Viru


1 Answers

Check your code you may be trying to perform an invalid operation.

In my case i was writing a file to C Drive after changing Location to D Drive Problem Resolved

like image 79
Girjesh Kumar Vishwakarma Avatar answered Nov 14 '22 21:11

Girjesh Kumar Vishwakarma