Code cleanup for admin#769
Merged
Merged
Conversation
Refactored logging across controllers to remove debug/timing logs and focus on meaningful events. Updated log levels in appsettings to "Error" for most sources and "Information" for DasBlog. Improved log messages for login failures, post edits/deletes, and site settings updates. Removed redundant and noisy log statements to ensure only significant events are logged.
- Updated EventDataItem to use placeholders for event code and URL, and ensure Params are stringified and non-null. - Enhanced AccountController logout logging to include username. - Removed LoggingAgent middleware and its registration from Startup. - Suppressed Microsoft.AspNetCore.Watch logs in appsettings files.
Refactored all admin-related controller actions to use consistent /admin/ route prefixes (e.g., /admin/post/, /admin/authors/, /admin/activity/). Updated TagHelpers, layout links, and views to match the new route structure. This improves route clarity, separates admin and public actions, and simplifies future maintenance.
Replaced ASP.NET tag helper links for "Author" and "Activity" in the admin dropdown menu with direct href URLs to improve navigation consistency.
Index now redirects to EditAuthor with email parameter. UpdateAuthor action formatting improved; redirect unchanged. Redirect to EditAuthor with email param in AuthorController Index now redirects to EditAuthor using the user's email. UpdateAuthor action formatting improved; redirect unchanged.
Switched ViewBag configuration in EditAuthor to use UsersEditMode for proper context. Removed redundant EditAuthor action that only returned the view, simplifying the controller logic.
Standardize activity log URLs from /admin/activity to /admin/log across controllers and views. Removed redundant EventsByQuery action and updated navigation and date links for consistency.
- Support multiple log file patterns (including rolled files) for better compatibility with rolling log setups. - Filter log entries to only include lines matching the requested date. - Open log files with FileShare.ReadWrite for concurrent access. - Use local date (DateTime.Today) as default in activity log view. - Ensure log directory path is always absolute. - Update activity log date selection form to use correct route and improve layout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Classification
Code cleanup and admin interface refactor to improve route consistency, logging, and maintainability.
PR Summary
This pull request standardizes admin routes, enhances activity log handling, and streamlines logging and configuration for better maintainability and usability.
/admin/...routes for posts, authors, and activity logs.