Baza.Infrastructure.Logging.EnterpriseLibrary.LoggingConfigurationFactory.Create C# (CSharp) 메소드

Create() 공개 정적인 메소드

public static Create ( string name, string filePath = null ) : Microsoft.Practices.EnterpriseLibrary.Logging.LoggingConfiguration
name string
filePath string
리턴 Microsoft.Practices.EnterpriseLibrary.Logging.LoggingConfiguration
        public static LoggingConfiguration Create(string name, string filePath = null)
        {
            if (string.IsNullOrWhiteSpace(name))
            {
                name = "Default";
            }

            // Trace Listeners
            var listener = new RollingFlatFileTraceListener((filePath ?? "Logging") + "\\" + name + ".log",
                header: string.Empty, footer: string.Empty, formatter: _SimplyFormatter,
                rollFileExistsBehavior: RollFileExistsBehavior.Increment, rollInterval: RollInterval.Day, maxArchivedFiles: 30);

            // Build Configuration
            var config = new LoggingConfiguration();
            config.DefaultSource = LogLevel.Information.ToString();
            config.IsLoggingEnabled = true;
            //config.AddLogSource(Logger.InformationCategoryName, SourceLevels.All, autoFlush: true).AddAsynchronousTraceListener(listener);
            // Special Sources Configuration
            //config.SpecialSources.Unprocessed.AddTraceListener(listener);
            config.SpecialSources.Unprocessed.Level = SourceLevels.All;
            config.SpecialSources.Unprocessed.AutoFlush = true;
            var eventLogListener = CreateEventLogTraceListener();
            config.SpecialSources.LoggingErrorsAndWarnings.AddTraceListener(eventLogListener);
            config.SpecialSources.LoggingErrorsAndWarnings.Level = SourceLevels.All;
            config.SpecialSources.LoggingErrorsAndWarnings.AutoFlush = true;
            // All Event
            config.SpecialSources.AllEvents.AddAsynchronousTraceListener(listener);
            config.SpecialSources.AllEvents.Level = SourceLevels.All;
            config.SpecialSources.AllEvents.AutoFlush = true;
            return config;
        }
LoggingConfigurationFactory