Exemplo n.º 1
0
        protected IConfigurationSource GetConfigurationSource()
        {
            var configSource = new DictionaryConfigurationSource();

            ConfigurationSourceBuilder.UpdateConfigurationWithReplace(configSource);
            return(configSource);
        }
Exemplo n.º 2
0
        protected SecuritySettings GetSecuritySettings()
        {
            IConfigurationSource source = new DictionaryConfigurationSource();

            configurationSourceBuilder.UpdateConfigurationWithReplace(source);

            return((SecuritySettings)source.GetSection(SecuritySettings.SectionName));
        }
Exemplo n.º 3
0
 private static void DefineLogger(IConfigurationSourceBuilder builder, IConfigurationSource source)
 {
     builder.ConfigureLogging()
            .WithOptions
              .DoNotRevertImpersonation()
            .LogToCategoryNamed(Settings.Default.LogToCategoryNamed)
            .WithOptions.SetAsDefaultCategory()
              .SendTo.RollingFile(Settings.Default.RollingFile)
              .RollAfterSize(Settings.Default.MaxLogFileSize)
                .FormatWith(new FormatterBuilder()
                  .TextFormatterNamed(Settings.Default.TextFormatterNamed)
                    .UsingTemplate(@"Timestamp: {timestamp},{newline}Message: {message},{newline}Category: {category},{newline}Severity: {severity},{newline}Title:{title},{newline}ProcessId: {localProcessId},{newline}Process Name: {localProcessName},{newline}Thread Name: {threadName},{newline}Method Name {property(MethodName)},{newline}Method Return Value: {property(ReturnValue)},{newline}Method Call Time: {property(CallTime)},{newline}Method Parameters: {dictionary({key} - {value} )}"))
                    .ToFile(Settings.Default.LogFileFolder);
     var configurationSource = CreateConfigurationSource(builder,source);
     builder.UpdateConfigurationWithReplace(configurationSource);
     Logger.SetLogWriter(new LogWriterFactory(configurationSource).Create());
 }
Exemplo n.º 4
0
 private static IConfigurationSource CreateConfigurationSource(IConfigurationSourceBuilder builder, IConfigurationSource configurationSource)
 {
     builder.UpdateConfigurationWithReplace(configurationSource);
     return configurationSource;
 }