public LogsharkConfiguration(LogsharkConfig config) { MongoConnectionInfo = new MongoConnectionInfo(config.MongoConnection); PostgresConnectionInfo = new PostgresConnectionInfo(config.PostgresConnection); TableauConnectionInfo = new TableauServerConnectionInfo(config.TableauConnection); LocalMongoOptions = new LogsharkLocalMongoOptions(config.RunOptions.LocalMongo); TuningOptions = new LogsharkTuningOptions(config.RunOptions.Tuning); ArtifactProcessorOptions = new LogsharkArtifactProcessorOptions(config.ArtifactProcessorOptions); }
/// <summary> /// Retrieves an application temp directory from config or defaults to the current user's Windows temp folder /// </summary> /// <returns>Path to temp directory.</returns> private static string GetApplicationTempDirectory(LogsharkConfig config) { try { return(string.IsNullOrWhiteSpace(config.RunOptions.TempFolder.Path) ? Path.Combine(Path.GetTempPath(), "Logshark") : Path.Combine(config.RunOptions.TempFolder.Path, "Logshark")); } catch (SecurityException) { // Default to trying to use a subfolder in the Logshark application directory. return(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Temp")); } }
public LogsharkConfiguration(LogsharkConfig config) { MongoConnectionInfo = new MongoConnectionInfo(config.MongoConnection); PostgresConnectionInfo = new PostgresConnectionInfo(config.PostgresConnection); TableauConnectionInfo = new TableauConnectionInfo(config.TableauConnection); LocalMongoOptions = new LogsharkLocalMongoOptions(config.RunOptions.LocalMongo); TuningOptions = new LogsharkTuningOptions(config.RunOptions.Tuning); DefaultPlugins = new HashSet <string>(); foreach (Plugin plugin in config.PluginOptions.DefaultPlugins) { DefaultPlugins.Add(plugin.Name); } }
public LogsharkConfiguration(LogsharkConfig config) { MongoConnectionInfo = new MongoConnectionInfo(config.MongoConnection); if (!string.IsNullOrWhiteSpace(config.PostgresConnection.Server.Server) && !config.PostgresConnection.Server.Server.Equals("unspecified", StringComparison.OrdinalIgnoreCase)) { PostgresConnectionInfo = Option.Some(new PostgresConnectionInfo(config.PostgresConnection)); } TableauConnectionInfo = new TableauServerConnectionInfo(config.TableauConnection); DataRetentionOptions = new LogsharkDataRetentionOptions(config.RunOptions.DataRetention); LocalMongoOptions = new LogsharkLocalMongoOptions(config.RunOptions.LocalMongo); TuningOptions = new LogsharkTuningOptions(config.RunOptions.Tuning); ArtifactProcessorOptions = new LogsharkArtifactProcessorOptions(config.ArtifactProcessorOptions); ApplicationTempDirectory = GetApplicationTempDirectory(config); ApplicationOutputDirectory = GetApplicationOutputDirectory(); }