using System; using System.ComponentModel.DataAnnotations.Schema; using Abp.Auditing; using Abp.Domain.Entities; namespace IwbZero.BaseSysInfo { [Table("Sys_AuditLogs")] public class IwbSysLog : Entity { /// /// Maximum length of property. /// public static int MaxServiceNameLength = 256; /// /// Maximum length of property. /// public static int MaxMethodNameLength = 256; /// /// Maximum length of property. /// public static int MaxParametersLength = 1024; /// /// Maximum length of property. /// public static int MaxClientIpAddressLength = 64; /// /// Maximum length of property. /// public static int MaxClientNameLength = 128; /// /// Maximum length of property. /// public static int MaxBrowserInfoLength = 512; /// /// Maximum length of property. /// public static int MaxExceptionLength = 2000; /// /// Maximum length of property. /// public static int MaxCustomDataLength = 2000; ///// ///// TenantId. ///// //public virtual int? TenantId { get; set; } /// /// UserId. /// public virtual long? UserId { get; set; } /// /// UserId. /// public virtual string UserName { get; set; } /// /// Service (class/interface) name. /// public virtual string ServiceName { get; set; } /// /// Executed method name. /// public virtual string MethodName { get; set; } /// /// Calling parameters. /// public virtual string Parameters { get; set; } /// /// Start time of the method execution. /// public virtual DateTime ExecutionTime { get; set; } /// /// Total duration of the method call as milliseconds. /// public virtual int ExecutionDuration { get; set; } /// /// IP address of the client. /// public virtual string ClientIpAddress { get; set; } /// /// Name (generally computer name) of the client. /// public virtual string ClientName { get; set; } /// /// Browser information if this method is called in a web request. /// public virtual string BrowserInfo { get; set; } /// /// Exception object, if an exception occured during execution of the method. /// public virtual string Exception { get; set; } /// /// . /// public virtual long? ImpersonatorUserId { get; set; } /// /// . /// public virtual int? ImpersonatorTenantId { get; set; } public virtual string CustomData { get; set; } public virtual int LogType { get; set; } public virtual IwbSysLog CreateFromAuditInfo(AuditInfo auditInfo) { return null; } public override string ToString() { return $"AUDIT LOG: {ServiceName}.{MethodName} is executed by user {UserId} in {ExecutionDuration} ms from {ClientIpAddress} IP address."; } } }