Wondering if someone can help me with this:
What i am trying to achieve is writing a full event log entry including log type and so on to a remote event log on Win2k8 server. I have already setup the SDDL for this for the correct SID so permissions are not an issue.
My issue here is that if i use the basic
message it works fine and the remote machine receives the request however when i try and enter a full entry it produces a warning of:
Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated
Which subsequently does not populate the event log on the remote machine.
Logging on the local machine is just not an option simply put they are wokring on TFTP images which are reset upon restart of the device and thus will lose any history.
This Works Fine:
My code so far:
Private MyEvtLog As EventLog
Dim Source As String = "My Product"
Dim Log As String = "Company Software"
Dim eMachine As String = "MyMachineName.Domain.Local"
Informational = 1
Warning = 2
Severe = 3
Critical = 4
MyEvtLog = New EventLog(Log, eMachine, Source)
Catch ex As Exception
Private Sub Logging_LoggingRequest(Severity As LoggingSeverity, DateTime As String, Message As String, ByVal Document As String, ByVal Routine As String)
Dim LogDataEntry As String =
LogDataEntry = String.Format(LogDataEntry, Environment.UserName, Environment.MachineName, Environment.UserDomainName, Severity, DateTime, Document, Routine, Message)
Select Case Severity
MyEvtLog.WriteEntry(Source, LogDataEntry, EventLogEntryType.Information, 0)
MyEvtLog.WriteEntry(Source, LogDataEntry, EventLogEntryType.Warning, 0)
MyEvtLog.WriteEntry(Source, LogDataEntry, EventLogEntryType.FailureAudit, 0)
MyEvtLog.WriteEntry(Source, LogDataEntry, EventLogEntryType.Error, 0)
Certainly would appreciate some info on writing a full event log entry to a remote machine, as currently this doesnt work but i need to be able to determine errors or warnings.