private void OnRaiseSystemEvents(object state) { try { var e = new SystemEventState(null); e.Initialize( SystemContext, null, EventSeverity.Medium, new LocalizedText("Raising Events")); e.SetChildValue(SystemContext, BrowseNames.SourceNode, ObjectIds.Server, false); e.SetChildValue(SystemContext, BrowseNames.SourceName, "Internal", false); Server.ReportEvent(e); var ae = new AuditEventState(null); ae.Initialize( SystemContext, null, EventSeverity.Medium, new LocalizedText("Events Raised"), true, DateTime.UtcNow); ae.SetChildValue(SystemContext, BrowseNames.SourceNode, ObjectIds.Server, false); ae.SetChildValue(SystemContext, BrowseNames.SourceName, "Internal", false); Server.ReportEvent(ae); } catch (Exception e) { Utils.Trace(e, "Unexpected error in OnRaiseSystemEvents"); } }
/// <summary> /// Initializes a session audit event. /// </summary> private void InitializeSessionAuditEvent(ServerSystemContext systemContext, AuditEventState e, TranslationInfo message) { e.Initialize( systemContext, null, EventSeverity.MediumLow, new LocalizedText(message), true, DateTime.UtcNow); e.SetChildValue(systemContext, BrowseNames.SourceNode, m_sessionId, false); e.SetChildValue(systemContext, BrowseNames.SourceName, m_sessionName, false); e.SetChildValue(systemContext, BrowseNames.SessionId, m_sessionId, false); e.SetChildValue(systemContext, BrowseNames.ServerId, m_server.ServerUris.GetString(0), false); e.SetChildValue(systemContext, BrowseNames.ClientUserId, m_identity.DisplayName, false); e.SetChildValue(systemContext, BrowseNames.ClientAuditEntryId, systemContext.OperationContext.AuditEntryId, false); }