Logging Enhancements (#1521)

* Recreated Kavita Logging with Serilog instead of Default. This needs to be move out of the appsettings now, to allow auto updater to patch.

* Refactored the code to be completely configured via Code rather than appsettings.json. This is a required step for Auto Updating.

* Added in the ability to send logs directly to the UI only for users on the log route. Stopping implementation as Alerts page will handle the rest of the implementation.

* Fixed up the backup service to not rely on Config from appsettings.json

* Tweaked the Logging levels available

* Moved everything over to File-scoped namespaces

* Moved everything over to File-scoped namespaces

* Code cleanup, removed an old migration and changed so debug logging doesn't print sensitive db data

* Removed dead code
This commit is contained in:
Joseph Milazzo 2022-09-12 19:25:48 -05:00 committed by GitHub
parent 9f715cc35f
commit d1a14f7e68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
212 changed files with 16599 additions and 16834 deletions

View file

@ -1,7 +1,6 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class CreateReadingListDto
{
public class CreateReadingListDto
{
public string Title { get; init; }
}
public string Title { get; init; }
}

View file

@ -1,18 +1,17 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class ReadingListDto
{
public class ReadingListDto
{
public int Id { get; init; }
public string Title { get; set; }
public string Summary { get; set; }
/// <summary>
/// Reading lists that are promoted are only done by admins
/// </summary>
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// This is used to tell the UI if it should request a Cover Image or not. If null or empty, it has not been set.
/// </summary>
public string CoverImage { get; set; } = string.Empty;
}
public int Id { get; init; }
public string Title { get; set; }
public string Summary { get; set; }
/// <summary>
/// Reading lists that are promoted are only done by admins
/// </summary>
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
/// <summary>
/// This is used to tell the UI if it should request a Cover Image or not. If null or empty, it has not been set.
/// </summary>
public string CoverImage { get; set; } = string.Empty;
}

View file

@ -1,25 +1,24 @@
using API.Entities.Enums;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class ReadingListItemDto
{
public class ReadingListItemDto
{
public int Id { get; init; }
public int Order { get; init; }
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public string SeriesName { get; set; }
public MangaFormat SeriesFormat { get; set; }
public int PagesRead { get; set; }
public int PagesTotal { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int VolumeId { get; set; }
public int LibraryId { get; set; }
public string Title { get; set; }
/// <summary>
/// Used internally only
/// </summary>
public int ReadingListId { get; set; }
}
public int Id { get; init; }
public int Order { get; init; }
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public string SeriesName { get; set; }
public MangaFormat SeriesFormat { get; set; }
public int PagesRead { get; set; }
public int PagesTotal { get; set; }
public string ChapterNumber { get; set; }
public string VolumeNumber { get; set; }
public int VolumeId { get; set; }
public int LibraryId { get; set; }
public string Title { get; set; }
/// <summary>
/// Used internally only
/// </summary>
public int ReadingListId { get; set; }
}

View file

@ -1,9 +1,8 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByChapterDto
{
public class UpdateReadingListByChapterDto
{
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int ChapterId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,12 +1,11 @@
using System.Collections.Generic;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByMultipleDto
{
public class UpdateReadingListByMultipleDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
public IReadOnlyList<int> VolumeIds { get; init; }
public IReadOnlyList<int> ChapterIds { get; init; }
}
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
public IReadOnlyList<int> VolumeIds { get; init; }
public IReadOnlyList<int> ChapterIds { get; init; }
}

View file

@ -1,10 +1,9 @@
using System.Collections.Generic;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByMultipleSeriesDto
{
public class UpdateReadingListByMultipleSeriesDto
{
public int ReadingListId { get; init; }
public IReadOnlyList<int> SeriesIds { get; init; }
}
public int ReadingListId { get; init; }
public IReadOnlyList<int> SeriesIds { get; init; }
}

View file

@ -1,8 +1,7 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListBySeriesDto
{
public class UpdateReadingListBySeriesDto
{
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,9 +1,8 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListByVolumeDto
{
public class UpdateReadingListByVolumeDto
{
public int VolumeId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}
public int VolumeId { get; init; }
public int SeriesId { get; init; }
public int ReadingListId { get; init; }
}

View file

@ -1,11 +1,10 @@
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
public class UpdateReadingListDto
{
public class UpdateReadingListDto
{
public int ReadingListId { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
}
public int ReadingListId { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public bool Promoted { get; set; }
public bool CoverImageLocked { get; set; }
}

View file

@ -1,18 +1,14 @@
using System.ComponentModel.DataAnnotations;
namespace API.DTOs.ReadingLists
namespace API.DTOs.ReadingLists;
/// <summary>
/// DTO for moving a reading list item to another position within the same list
/// </summary>
public class UpdateReadingListPosition
{
/// <summary>
/// DTO for moving a reading list item to another position within the same list
/// </summary>
public class UpdateReadingListPosition
{
[Required]
public int ReadingListId { get; set; }
[Required]
public int ReadingListItemId { get; set; }
public int FromPosition { get; set; }
[Required]
public int ToPosition { get; set; }
}
[Required] public int ReadingListId { get; set; }
[Required] public int ReadingListItemId { get; set; }
public int FromPosition { get; set; }
[Required] public int ToPosition { get; set; }
}