M
Majed
hi
i'v created a service that do nothing except writing to the log event from a
timer event. but it did not
the started and stopped succesfully logs do show in the applaction log.I
created a windows form app that do the same...and it worked!?
i tried all posible account property...here is the code from my timer event
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
' Create an EventLog instance and assign its source.
Dim myLog As New EventLog
myLog.Source = "Service1"
myLog.Log = "Application"
' Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log." & vbCrLf & Now.ToString)
end sub
i tried using the service eventlog like this:
Me.EventLog.WriteEntry("Service 1 stopped succesfully at:" & vbCrLf &
Now.ToString, EventLogEntryType.Warning, Now.Millisecond)
it did not work either
then i set the autolog property to false and wrot from onstart and onstop to
the log and IT WORKED!! but not from the timer event
is it security or WHAT?!
please help
TIA
Majed
i'v created a service that do nothing except writing to the log event from a
timer event. but it did not
the started and stopped succesfully logs do show in the applaction log.I
created a windows form app that do the same...and it worked!?
i tried all posible account property...here is the code from my timer event
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
' Create an EventLog instance and assign its source.
Dim myLog As New EventLog
myLog.Source = "Service1"
myLog.Log = "Application"
' Write an informational entry to the event log.
myLog.WriteEntry("Writing to event log." & vbCrLf & Now.ToString)
end sub
i tried using the service eventlog like this:
Me.EventLog.WriteEntry("Service 1 stopped succesfully at:" & vbCrLf &
Now.ToString, EventLogEntryType.Warning, Now.Millisecond)
it did not work either
then i set the autolog property to false and wrot from onstart and onstop to
the log and IT WORKED!! but not from the timer event
is it security or WHAT?!
please help
TIA
Majed