README

Applyze Log Service

Welcome Index of documentations of Applyze Audit Log.

Summary

This service allows you to easily filter logs.

You can add unlimited log providers with the log resolver.


        /// <summary>
        /// Get audit log provider
        /// </summary>
        /// <returns></returns>
        public IOperationService GetLogService()
        {
            try
            {
                var logServiceType = _configuration.GetSection("AuditLogConnection:LogServiceType").Value;
                switch (logServiceType)
                {
                    case nameof(AuditLogServiceType.Aws):
                        return _serviceProvider.GetService<AwsOperationManager>();
                    case nameof(AuditLogServiceType.Mongo):
                        return _serviceProvider.GetService<MongoOperationManager>();
                }
            }
            catch (Exception ex)
            {
                throw new NotConfiguredException(Constants.ResolverMessages.NOT_CONFIGURED + " " + ex.Message);
            }
            return null;
        }

Entities

    public class Log : AuditEvent
    {
        [BsonElement("_id")]
        public ObjectId Id { get; set; }

        [BsonElement("UserEmail")]
        public string UserEmail { get; set; }
        
        [BsonElement("UserId")]
        public string UserId { get; set; }

        [BsonElement("UserAgent")]
        public string UserAgent { get; set; }

        [BsonElement("IP")]
        public string IP { get; set; }

        [BsonElement("Context")]
        public string Context { get; set; }
        
        [BsonElement("ActionType")]
        public string ActionType { get; set; }

        [BsonElement("AppId")]
        public string AppId { get; set; }
    }