Ejemplo n.º 1
0
 /// <summary>
 /// Writes an event to the Legion event log
 /// </summary>
 /// <param name="affectedUserType">the type of user which is being acted upon</param>
 /// <param name="affectedUserId">the id of the user which is being acted upon</param>
 /// <param name="group">the log group</param>
 /// <param name="eventLevel">the priority level of the event</param>
 /// <param name="eventType">the type of event</param>
 /// <param name="details">the event details</param>
 /// <returns>The event id of the new entry</returns>
 public int WriteEvent(string affectedUserType, string affectedUserId, string group, EventLevel eventLevel, string eventType, string details)
 {
     return(Modules.Logging.Module.WriteEvent(new Modules.LoggedEvent(eventLevel.ToEventLevel(), eventType, details)
     {
         Group = group,
         ApplicationType = ApplicationType.ToApplicationType(),
         ApplicationName = ApplicationName,
         ApplicationId = ApplicationId,
         LoggingUserType = LoggingUserType,
         LoggingUserId = LoggingUserId,
         AffectedUserType = affectedUserType,
         AffectedUserId = affectedUserId,
         ClientIp = Request.Current.Requestor.ClientIPAddress,
         HostIp = ServerDetails.IPv4Addresses.First().ToString()
     }));
 }