Skip to content

Commit

Permalink
Remove unused settings (Log404Errors)
Browse files Browse the repository at this point in the history
  • Loading branch information
support committed Dec 27, 2023
1 parent 67a9840 commit bb40668
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ await _settingService.SaveSetting(new CommonSettings {
SitemapIncludeCategories = true,
SitemapIncludeBrands = true,
SitemapIncludeProducts = false,
Log404Errors = true,
PopupForTermsOfServiceLinks = true,
AllowToSelectStore = false
});
Expand Down
5 changes: 0 additions & 5 deletions src/Core/Grand.Domain/Common/CommonSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public CommonSettings()
/// </summary>
public List<string> SitemapCustomUrls { get; set; }

/// <summary>
/// Gets or sets a value indicating whether 404 errors (page or file not found) should be logged
/// </summary>
public bool Log404Errors { get; set; }

/// <summary>
/// Gets or sets a ignore words (phrases) to be ignored when logging errors/messages
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,19 +296,7 @@
<span asp-validation-for="CommonSettings.PopupForTermsOfServiceLinks"></span>
</div>
</div>
<div class="form-group">
<div class="col-8 col-md-4 col-sm-4 text-right">
<admin-label asp-for="CommonSettings.Log404Errors" class="control-label" />
</div>
<div class="col-4 col-md-8 col-sm-8">
<label class="mt-checkbox mt-checkbox-outline control control-checkbox">
<admin-input asp-for="CommonSettings.Log404Errors" />
<div class="control__indicator"></div>
</label>
<span asp-validation-for="CommonSettings.Log404Errors"></span>
</div>
</div>
<div class="form-group">
<div class="form-group">
<div class="col-8 col-md-4 col-sm-4 text-right">
<admin-label asp-for="CommonSettings.SitemapEnabled" class="control-label" />
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ public class CommonSettingsModel : BaseModel
[GrandResourceDisplayName("Admin.Settings.GeneralCommon.AllowToSelectStore")]
public bool AllowToSelectStore { get; set; }

[GrandResourceDisplayName("Admin.Settings.GeneralCommon.Log404Errors")]
public bool Log404Errors { get; set; }

[GrandResourceDisplayName("Admin.Settings.GeneralCommon.PopupForTermsOfServiceLinks")]
public bool PopupForTermsOfServiceLinks { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ public static void UsePageNotFound(this IApplicationBuilder application)
const string location = "/page-not-found";
context.HttpContext.Response.Redirect(context.HttpContext.Request.PathBase + location);
}
var commonSettings = context.HttpContext.RequestServices.GetRequiredService<CommonSettings>();
if (commonSettings.Log404Errors)
{
var logger = context.HttpContext.RequestServices.GetRequiredService<ILoggerFactory>().CreateLogger("UseStatusCodePages");
logger.LogError("Error 404. The requested page ({DisplayUrl}) was not found", context.HttpContext.Request.GetDisplayUrl());
}
}
await Task.CompletedTask;
});
Expand Down
3 changes: 0 additions & 3 deletions src/Web/Grand.Web/App_Data/Resources/DefaultLanguage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10266,9 +10266,6 @@
<Resource Name="Admin.Settings.GeneralCommon.LinkedInLink" Area="Admin">
<Value>LinkedIn page URL</Value>
</Resource>
<Resource Name="Admin.Settings.GeneralCommon.Log404Errors" Area="Admin">
<Value>Log 404 errors</Value>
</Resource>
<Resource Name="Admin.Settings.GeneralCommon.Logo" Area="Admin">
<Value>Logo</Value>
</Resource>
Expand Down

0 comments on commit bb40668

Please sign in to comment.