diff --git a/src/BirdsiteLive.Common/Settings/LogsSettings.cs b/src/BirdsiteLive.Common/Settings/LogsSettings.cs
new file mode 100644
index 0000000..4919417
--- /dev/null
+++ b/src/BirdsiteLive.Common/Settings/LogsSettings.cs
@@ -0,0 +1,8 @@
+namespace BirdsiteLive.Common.Settings
+{
+ public class LogsSettings
+ {
+ public string Type { get; set; }
+ public string InstrumentationKey { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/BirdsiteLive/BirdsiteLive.csproj b/src/BirdsiteLive/BirdsiteLive.csproj
index 8b92b7c..4d21924 100644
--- a/src/BirdsiteLive/BirdsiteLive.csproj
+++ b/src/BirdsiteLive/BirdsiteLive.csproj
@@ -9,6 +9,7 @@
+
diff --git a/src/BirdsiteLive/Startup.cs b/src/BirdsiteLive/Startup.cs
index c2d7cb0..a6806b9 100644
--- a/src/BirdsiteLive/Startup.cs
+++ b/src/BirdsiteLive/Startup.cs
@@ -38,8 +38,12 @@ namespace BirdsiteLive
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
- //services.Configure(Configuration.GetSection("Instance"));
- //services.Configure(Configuration.GetSection("Twitter"));
+ var logsSettings = Configuration.GetSection("Logging").Get();
+ if(string.Equals("insights", logsSettings.Type, StringComparison.OrdinalIgnoreCase))
+ {
+ var key = logsSettings.InstrumentationKey;
+ services.AddApplicationInsightsTelemetry(key);
+ }
services.AddControllersWithViews();
}
@@ -55,6 +59,9 @@ namespace BirdsiteLive
var dbSettings = Configuration.GetSection("Db").Get();
services.For().Use(x => dbSettings);
+ var logsSettings = Configuration.GetSection("Logging").Get();
+ services.For().Use(x => logsSettings);
+
if (string.Equals(dbSettings.Type, DbTypes.Postgres, StringComparison.OrdinalIgnoreCase))
{
var connString = $"Host={dbSettings.Host};Username={dbSettings.User};Password={dbSettings.Password};Database={dbSettings.Name}";
diff --git a/src/BirdsiteLive/appsettings.json b/src/BirdsiteLive/appsettings.json
index 88712f8..f240094 100644
--- a/src/BirdsiteLive/appsettings.json
+++ b/src/BirdsiteLive/appsettings.json
@@ -1,5 +1,7 @@
{
"Logging": {
+ "Type": "none",
+ "InstrumentationKey": "key",
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",