Exemplo n.º 1
0
        public void Maintain(AuuLogOptions options)
        {
            if (options.KeepLogNumber > 0)
            {
                options.DbLogger.DeleteLogs(options.KeepLogNumber);
            }

            if (options.KeepLogAfter > new DateTime())
            {
                options.DbLogger.DeleteLogsBefore(options.KeepLogAfter);
            }
        }
Exemplo n.º 2
0
        public static IApplicationBuilder UseAuuLog(
            this IApplicationBuilder app,
            Action <AuuLogOptions> setupAction = null)
        {
            if (setupAction == null)
            {
                app.UseMiddleware <AuuLogMiddleware>();
            }
            else
            {
                var auuLogOptions = new AuuLogOptions();
                setupAction(auuLogOptions);
                app.UseMiddleware <AuuLogMiddleware>((object)auuLogOptions);
            }

            return(app);
        }
Exemplo n.º 3
0
 public AuuLogMiddleware(RequestDelegate next, AuuLogOptions options)
 {
     _next    = next;
     _options = options;
 }
Exemplo n.º 4
0
 public void InitDb(AuuLogOptions options)
 {
     options.DbLogger.CreateTable(options.LogTableName);
 }