diff --git a/benchmarks/Benchmarks.csproj b/benchmarks/Benchmarks.csproj
index 1e8b227f3c..9f3320575b 100644
--- a/benchmarks/Benchmarks.csproj
+++ b/benchmarks/Benchmarks.csproj
@@ -10,6 +10,6 @@
-
+
diff --git a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
index 94e2a404a9..e588c81b4e 100755
--- a/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
+++ b/src/Examples/JsonApiDotNetCoreExample/JsonApiDotNetCoreExample.csproj
@@ -25,9 +25,4 @@
-
-
-
-
-
diff --git a/src/Examples/JsonApiDotNetCoreExample/Startup.cs b/src/Examples/JsonApiDotNetCoreExample/Startup.cs
index 378a948a61..2c7574e1a2 100644
--- a/src/Examples/JsonApiDotNetCoreExample/Startup.cs
+++ b/src/Examples/JsonApiDotNetCoreExample/Startup.cs
@@ -28,7 +28,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
- loggerFactory.AddConsole(LogLevel.Trace);
+ loggerFactory.AddConsole(LogLevel.Warning);
services
.AddSingleton(loggerFactory)
@@ -57,7 +57,6 @@ public virtual void Configure(
context.Database.EnsureCreated();
loggerFactory.AddConsole(Config.GetSection("Logging"));
- loggerFactory.AddDebug();
app.UseJsonApi();
}
diff --git a/src/Examples/NoEntityFrameworkExample/Startup.cs b/src/Examples/NoEntityFrameworkExample/Startup.cs
index dfba27ddd9..b1f1d05188 100755
--- a/src/Examples/NoEntityFrameworkExample/Startup.cs
+++ b/src/Examples/NoEntityFrameworkExample/Startup.cs
@@ -1,4 +1,4 @@
-using JsonApiDotNetCore.Extensions;
+using JsonApiDotNetCore.Extensions;
using JsonApiDotNetCore.Services;
using JsonApiDotNetCoreExample.Data;
using JsonApiDotNetCoreExample.Models;
@@ -55,7 +55,6 @@ public virtual IServiceProvider ConfigureServices(IServiceCollection services)
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, AppDbContext context)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
- loggerFactory.AddDebug();
context.Database.EnsureCreated();
diff --git a/src/Examples/OperationsExample/OperationsExample.csproj b/src/Examples/OperationsExample/OperationsExample.csproj
index 69ad5653ce..02eeabe976 100644
--- a/src/Examples/OperationsExample/OperationsExample.csproj
+++ b/src/Examples/OperationsExample/OperationsExample.csproj
@@ -8,7 +8,7 @@
-
+
@@ -26,9 +26,4 @@
-
-
-
-
-
diff --git a/src/Examples/OperationsExample/Startup.cs b/src/Examples/OperationsExample/Startup.cs
index c11a3e9d26..a889ad85d6 100644
--- a/src/Examples/OperationsExample/Startup.cs
+++ b/src/Examples/OperationsExample/Startup.cs
@@ -27,7 +27,7 @@ public Startup(IHostingEnvironment env)
public virtual IServiceProvider ConfigureServices(IServiceCollection services)
{
var loggerFactory = new LoggerFactory();
- loggerFactory.AddConsole(LogLevel.Trace);
+ loggerFactory.AddConsole(LogLevel.Warning);
services.AddSingleton(loggerFactory);
@@ -47,7 +47,6 @@ public virtual void Configure(
context.Database.EnsureCreated();
loggerFactory.AddConsole(Config.GetSection("Logging"));
- loggerFactory.AddDebug();
app.UseJsonApi();
}
diff --git a/src/Examples/ReportsExample/appsettings.json b/src/Examples/ReportsExample/appsettings.json
index 125f7a4ae9..5766595e6d 100644
--- a/src/Examples/ReportsExample/appsettings.json
+++ b/src/Examples/ReportsExample/appsettings.json
@@ -2,7 +2,7 @@
"Logging": {
"IncludeScopes": false,
"LogLevel": {
- "Default": "Information"
+ "Default": "Warning"
}
}
}
diff --git a/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs b/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs
index 20d119ff07..500101cc62 100644
--- a/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs
+++ b/src/JsonApiDotNetCore/Serialization/JsonApiSerializer.cs
@@ -65,7 +65,11 @@ private string GetErrorJson(object responseObject, ILogger logger)
}
else
{
- logger?.LogInformation("Response was not a JSONAPI entity. Serializing as plain JSON.");
+ if (logger?.IsEnabled(LogLevel.Information) == true)
+ {
+ logger.LogInformation("Response was not a JSONAPI entity. Serializing as plain JSON.");
+ }
+
return JsonConvert.SerializeObject(responseObject);
}
}
diff --git a/src/JsonApiDotNetCore/Services/EntityResourceService.cs b/src/JsonApiDotNetCore/Services/EntityResourceService.cs
index 642ee00a57..a3094eb8f9 100644
--- a/src/JsonApiDotNetCore/Services/EntityResourceService.cs
+++ b/src/JsonApiDotNetCore/Services/EntityResourceService.cs
@@ -89,8 +89,10 @@ public virtual async Task