Пример #1
0
        public async Task Log(IWebLogContext context)
        {
            var fileContext = (FileWebLogContext)context;
            if (!fileContext.LoggingEnabled)
                return;

            var path = GetDirectoryName(fileContext);

            var targetPath = await Task.Run(delegate
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                return Path.Combine(path, GetFileName(fileContext));
            });

            await WriteToFile(fileContext, targetPath);
        }
Пример #2
0
        public async Task Log(IWebLogContext context)
        {
            var fileContext = (FileWebLogContext)context;

            if (!fileContext.LoggingEnabled)
            {
                return;
            }

            var path = GetDirectoryName(fileContext);

            var targetPath = await Task.Run(delegate
            {
                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                return(Path.Combine(path, GetFileName(fileContext)));
            });

            await WriteToFile(fileContext, targetPath);
        }
 public DetailWebLogger(IWebLogContext webLogContext)
 {
     this.webLogContext = webLogContext;
 }
 public DetailWebLogger(IWebLogContext webLogContext)
 {
     this.webLogContext = webLogContext;
 }