diff --git a/cloudscribe.Logging.sln b/cloudscribe.Logging.sln index 956fbc5..1f2c616 100644 --- a/cloudscribe.Logging.sln +++ b/cloudscribe.Logging.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29209.152 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35521.163 d17.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{46FB9706-B599-4853-95FD-58E2D553C5F7}" EndProject @@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Logging.EFCore. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Logging.EFCore.MySql", "src\cloudscribe.Logging.EFCore.MySql\cloudscribe.Logging.EFCore.MySql.csproj", "{BEAF528E-90EA-43B8-9E61-6340B8395EF8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Logging.EFCore.pgsql", "src\cloudscribe.Logging.EFCore.pgsql\cloudscribe.Logging.EFCore.pgsql.csproj", "{3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Logging.EFCore.SQLite", "src\cloudscribe.Logging.EFCore.SQLite\cloudscribe.Logging.EFCore.SQLite.csproj", "{E30B3FF2-DF66-43D0-A445-28F02EBB5C34}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cloudscribe.Logging", "src\cloudscribe.Logging\cloudscribe.Logging.csproj", "{1E64CA28-006E-4AD8-BAB4-FB8096C6AC4D}" @@ -55,10 +53,6 @@ Global {BEAF528E-90EA-43B8-9E61-6340B8395EF8}.Debug|Any CPU.Build.0 = Debug|Any CPU {BEAF528E-90EA-43B8-9E61-6340B8395EF8}.Release|Any CPU.ActiveCfg = Release|Any CPU {BEAF528E-90EA-43B8-9E61-6340B8395EF8}.Release|Any CPU.Build.0 = Release|Any CPU - {3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897}.Release|Any CPU.Build.0 = Release|Any CPU {E30B3FF2-DF66-43D0-A445-28F02EBB5C34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {E30B3FF2-DF66-43D0-A445-28F02EBB5C34}.Debug|Any CPU.Build.0 = Debug|Any CPU {E30B3FF2-DF66-43D0-A445-28F02EBB5C34}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -89,7 +83,6 @@ Global {0D17DD9B-D820-4CCE-9C83-784E69AADED0} = {46FB9706-B599-4853-95FD-58E2D553C5F7} {8DA73C1A-8E7E-4832-B476-1503C6080490} = {46FB9706-B599-4853-95FD-58E2D553C5F7} {BEAF528E-90EA-43B8-9E61-6340B8395EF8} = {46FB9706-B599-4853-95FD-58E2D553C5F7} - {3EFC6E9A-3C47-4B77-B2CE-2DBAFEDCC897} = {46FB9706-B599-4853-95FD-58E2D553C5F7} {E30B3FF2-DF66-43D0-A445-28F02EBB5C34} = {46FB9706-B599-4853-95FD-58E2D553C5F7} {1E64CA28-006E-4AD8-BAB4-FB8096C6AC4D} = {46FB9706-B599-4853-95FD-58E2D553C5F7} {529323E2-AA3A-4350-BDE3-4AC80555FD9A} = {46FB9706-B599-4853-95FD-58E2D553C5F7} diff --git a/src/Demo.WebApp/Demo.WebApp.csproj b/src/Demo.WebApp/Demo.WebApp.csproj index 4f125fe..56b2310 100644 --- a/src/Demo.WebApp/Demo.WebApp.csproj +++ b/src/Demo.WebApp/Demo.WebApp.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -24,22 +24,21 @@ - - - - - - - - - - + + + + + + + + + + - diff --git a/src/WebAppMvc/WebAppMvc.csproj b/src/WebAppMvc/WebAppMvc.csproj index 0fbf3ae..7dc8702 100644 --- a/src/WebAppMvc/WebAppMvc.csproj +++ b/src/WebAppMvc/WebAppMvc.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -9,7 +9,6 @@ - diff --git a/src/cloudscribe.Logging.EFCore.Common/README.md b/src/cloudscribe.Logging.EFCore.Common/README.md new file mode 100644 index 0000000..cb3114d --- /dev/null +++ b/src/cloudscribe.Logging.EFCore.Common/README.md @@ -0,0 +1,9 @@ +# cloudscribe.Logging.EFCore.Common + +Entity Framework Core implementation of cloudscribe ILogRepository. + +## Features +- Common EF Core logic for cloudscribe logging repositories + +## License +Apache-2.0 diff --git a/src/cloudscribe.Logging.EFCore.Common/cloudscribe.Logging.EFCore.Common.csproj b/src/cloudscribe.Logging.EFCore.Common/cloudscribe.Logging.EFCore.Common.csproj index 2181dab..cda24b1 100644 --- a/src/cloudscribe.Logging.EFCore.Common/cloudscribe.Logging.EFCore.Common.csproj +++ b/src/cloudscribe.Logging.EFCore.Common/cloudscribe.Logging.EFCore.Common.csproj @@ -2,13 +2,14 @@ Entity Framework Core implementation of cloudscribe ILogRepository - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git @@ -16,6 +17,7 @@ + diff --git a/src/cloudscribe.Logging.EFCore.MSSQL/cloudscribe.Logging.EFCore.MSSQL.csproj b/src/cloudscribe.Logging.EFCore.MSSQL/cloudscribe.Logging.EFCore.MSSQL.csproj index 10ec8f1..69587f1 100644 --- a/src/cloudscribe.Logging.EFCore.MSSQL/cloudscribe.Logging.EFCore.MSSQL.csproj +++ b/src/cloudscribe.Logging.EFCore.MSSQL/cloudscribe.Logging.EFCore.MSSQL.csproj @@ -2,19 +2,21 @@ MSSQL Entity Framework Core implementation of cloudscribe ILogRepository - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git + @@ -23,7 +25,7 @@ - + diff --git a/src/cloudscribe.Logging.EFCore.MySql/cloudscribe.Logging.EFCore.MySql.csproj b/src/cloudscribe.Logging.EFCore.MySql/cloudscribe.Logging.EFCore.MySql.csproj index 3abd734..65b6045 100644 --- a/src/cloudscribe.Logging.EFCore.MySql/cloudscribe.Logging.EFCore.MySql.csproj +++ b/src/cloudscribe.Logging.EFCore.MySql/cloudscribe.Logging.EFCore.MySql.csproj @@ -2,14 +2,14 @@ MySQL Entity Framework Core implementation of cloudscribe ILogRepository - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 - + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git @@ -17,6 +17,7 @@ + @@ -25,7 +26,7 @@ - + diff --git a/src/cloudscribe.Logging.EFCore.PostgreSql/cloudscribe.Logging.EFCore.PostgreSql.csproj b/src/cloudscribe.Logging.EFCore.PostgreSql/cloudscribe.Logging.EFCore.PostgreSql.csproj index 9ca5b82..3391deb 100644 --- a/src/cloudscribe.Logging.EFCore.PostgreSql/cloudscribe.Logging.EFCore.PostgreSql.csproj +++ b/src/cloudscribe.Logging.EFCore.PostgreSql/cloudscribe.Logging.EFCore.PostgreSql.csproj @@ -2,14 +2,14 @@ PostgreSql Entity Framework Core implementation of cloudscribe ILogRepository, using snake case tables and fields - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 - + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git @@ -18,6 +18,7 @@ + @@ -27,7 +28,7 @@ - + diff --git a/src/cloudscribe.Logging.EFCore.SQLite/cloudscribe.Logging.EFCore.SQLite.csproj b/src/cloudscribe.Logging.EFCore.SQLite/cloudscribe.Logging.EFCore.SQLite.csproj index eec8c25..7445863 100644 --- a/src/cloudscribe.Logging.EFCore.SQLite/cloudscribe.Logging.EFCore.SQLite.csproj +++ b/src/cloudscribe.Logging.EFCore.SQLite/cloudscribe.Logging.EFCore.SQLite.csproj @@ -2,19 +2,21 @@ SQLite Entity Framework Core implementation of cloudscribe ILogRepository - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git + @@ -25,7 +27,7 @@ - + diff --git a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContext.cs b/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContext.cs deleted file mode 100644 index 0274573..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContext.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Source Tree Solutions, LLC. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Author: Joe Audette -// Created: 2016-11-10 -// Last Modified: 2016-11-10 -// - -using cloudscribe.Logging.Models; -using Microsoft.EntityFrameworkCore; - -namespace cloudscribe.Logging.EFCore.pgsql -{ - public class LoggingDbContext : LoggingDbContextBase, ILoggingDbContext - { - - public LoggingDbContext( - DbContextOptions options) : base(options) - { - // we don't want to track any logitems because we dont edit them - // we add them delete them and view them - //ChangeTracker.AutoDetectChangesEnabled = false; - ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking; - - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - - modelBuilder.HasSequence("LogIds") - .StartsAt(1) - .IncrementsBy(1); - - modelBuilder.HasPostgresExtension("uuid-ossp"); - - modelBuilder.Entity(entity => - { - entity.ToTable("cs_SystemLog"); - entity.HasKey(p => p.Id); - - entity.Property(p => p.Id).IsRequired(); - - entity.Property(p => p.LogDateUtc).HasColumnName("LogDate"); - - entity.Property(p => p.IpAddress).HasMaxLength(50); - - entity.Property(p => p.Culture).HasMaxLength(10); - - entity.Property(p => p.ShortUrl).HasMaxLength(255); - - entity.Property(p => p.Thread).HasMaxLength(255); - - entity.Property(p => p.LogLevel).HasMaxLength(20); - - entity.Property(p => p.Logger).HasMaxLength(255); - - }); - - } - - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextDesignTimeFactory.cs b/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextDesignTimeFactory.cs deleted file mode 100644 index b591b06..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextDesignTimeFactory.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; - -namespace cloudscribe.Logging.EFCore.pgsql -{ - public class LoggingDbContextDesignTimeFactory : IDesignTimeDbContextFactory - { - public LoggingDbContext CreateDbContext(string[] args) - { - var builder = new DbContextOptionsBuilder(); - builder.UseNpgsql("server=yourservername;UID=yourdatabaseusername;PWD=yourdatabaseuserpassword;database=yourdatabasename"); - - return new LoggingDbContext(builder.Options); - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextFactory.cs b/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextFactory.cs deleted file mode 100644 index 5d4682b..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/LoggingDbContextFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Microsoft.EntityFrameworkCore; - -namespace cloudscribe.Logging.EFCore.pgsql -{ - public class LoggingDbContextFactory : ILoggingDbContextFactory - { - public LoggingDbContextFactory(DbContextOptions options) - { - dbContextOptions = options; - } - - private DbContextOptions dbContextOptions; - - public ILoggingDbContext CreateContext() - { - return new LoggingDbContext(dbContextOptions); - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.Designer.cs b/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.Designer.cs deleted file mode 100644 index 1db280c..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.Designer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using System; - -namespace cloudscribe.Logging.EFCore.pgsql.Migrations -{ - [DbContext(typeof(LoggingDbContext))] - [Migration("20170204141918_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:PostgresExtension:uuid-ossp", "'uuid-ossp', '', ''") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") - .HasAnnotation("Relational:Sequence:.LogIds", "'LogIds', '', '1', '1', '', '', 'Int64', 'False'"); - - modelBuilder.Entity("cloudscribe.Logging.Web.LogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Culture") - .HasMaxLength(10); - - b.Property("EventId"); - - b.Property("IpAddress") - .HasMaxLength(50); - - b.Property("LogDateUtc") - .HasColumnName("LogDate"); - - b.Property("LogLevel") - .HasMaxLength(20); - - b.Property("Logger") - .HasMaxLength(255); - - b.Property("Message"); - - b.Property("ShortUrl") - .HasMaxLength(255); - - b.Property("StateJson"); - - b.Property("Thread") - .HasMaxLength(255); - - b.Property("Url"); - - b.HasKey("Id"); - - b.ToTable("cs_SystemLog"); - }); - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.cs b/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.cs deleted file mode 100644 index 6898206..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/20170204141918_Initial.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace cloudscribe.Logging.EFCore.pgsql.Migrations -{ - public partial class Initial : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterDatabase() - .Annotation("Npgsql:PostgresExtension:uuid-ossp", "'uuid-ossp', '', ''"); - - migrationBuilder.CreateSequence( - name: "LogIds"); - - migrationBuilder.CreateTable( - name: "cs_SystemLog", - columns: table => new - { - Id = table.Column(nullable: false), - Culture = table.Column(maxLength: 10, nullable: true), - EventId = table.Column(nullable: false), - IpAddress = table.Column(maxLength: 50, nullable: true), - LogDate = table.Column(nullable: false), - LogLevel = table.Column(maxLength: 20, nullable: true), - Logger = table.Column(maxLength: 255, nullable: true), - Message = table.Column(nullable: true), - ShortUrl = table.Column(maxLength: 255, nullable: true), - StateJson = table.Column(nullable: true), - Thread = table.Column(maxLength: 255, nullable: true), - Url = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_cs_SystemLog", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "cs_SystemLog"); - - migrationBuilder.DropSequence( - name: "LogIds"); - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/LoggingDbContextModelSnapshot.cs b/src/cloudscribe.Logging.EFCore.pgsql/Migrations/LoggingDbContextModelSnapshot.cs deleted file mode 100644 index b093a20..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/Migrations/LoggingDbContextModelSnapshot.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -using System; - -namespace cloudscribe.Logging.EFCore.pgsql.Migrations -{ - [DbContext(typeof(LoggingDbContext))] - partial class LoggingDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("Npgsql:PostgresExtension:uuid-ossp", "'uuid-ossp', '', ''") - .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) - .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") - .HasAnnotation("Relational:Sequence:.LogIds", "'LogIds', '', '1', '1', '', '', 'Int64', 'False'"); - - modelBuilder.Entity("cloudscribe.Logging.Web.LogItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Culture") - .HasMaxLength(10); - - b.Property("EventId"); - - b.Property("IpAddress") - .HasMaxLength(50); - - b.Property("LogDateUtc") - .HasColumnName("LogDate"); - - b.Property("LogLevel") - .HasMaxLength(20); - - b.Property("Logger") - .HasMaxLength(255); - - b.Property("Message"); - - b.Property("ShortUrl") - .HasMaxLength(255); - - b.Property("StateJson"); - - b.Property("Thread") - .HasMaxLength(255); - - b.Property("Url"); - - b.HasKey("Id"); - - b.ToTable("cs_SystemLog"); - }); - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/README.md b/src/cloudscribe.Logging.EFCore.pgsql/README.md deleted file mode 100644 index fcb9127..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# cloudscribe.Logging.EFCore.pgsql - -## How to generate migrations - -Since this project is a netstandard20 class library it is not executable, therefore you have to pass in the --startup-project that is executable - -dotnet ef --startup-project ../Demo.WebApp migrations add [Migration Name] --context cloudscribe.Logging.EFCore.pgsql.LoggingDbContext \ No newline at end of file diff --git a/src/cloudscribe.Logging.EFCore.pgsql/ServiceCollectionExtensions.cs b/src/cloudscribe.Logging.EFCore.pgsql/ServiceCollectionExtensions.cs deleted file mode 100644 index 83dee43..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/ServiceCollectionExtensions.cs +++ /dev/null @@ -1,59 +0,0 @@ -using cloudscribe.Logging; -using cloudscribe.Logging.EFCore; -using cloudscribe.Logging.EFCore.Common; -using cloudscribe.Logging.EFCore.pgsql; -using cloudscribe.Logging.Models; -using cloudscribe.Versioning; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection.Extensions; -using System; -using System.Collections.Generic; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class ServiceCollectionExtensions - { - public static IServiceCollection AddCloudscribeLoggingEFStoragePostgreSql( - this IServiceCollection services, - string connectionString, - int maxConnectionRetryCount = 0, - int maxConnectionRetryDelaySeconds = 30, - ICollection transientErrorCodesToAdd = null - ) - { - - // AddEntityFrameworkNpgsql call should be deprecated: - // https://www.npgsql.org/efcore/api/Microsoft.Extensions.DependencyInjection.NpgsqlServiceCollectionExtensions.html - - services - .AddDbContext(options => - options.UseNpgsql(connectionString, - npgsqlOptionsAction: sqlOptions => - { - sqlOptions.UseQuerySplittingBehavior(QuerySplittingBehavior.SingleQuery); // pagination likely here - - if (maxConnectionRetryCount > 0) - { - //Configuring Connection Resiliency: https://docs.microsoft.com/en-us/ef/core/miscellaneous/connection-resiliency - sqlOptions.EnableRetryOnFailure( - maxRetryCount: maxConnectionRetryCount, - maxRetryDelay: TimeSpan.FromSeconds(maxConnectionRetryDelaySeconds), - errorCodesToAdd: transientErrorCodesToAdd); - } - }), - optionsLifetime: ServiceLifetime.Singleton - ); - - - - services.TryAddScoped(); - services.AddCloudscribeLoggingEFCommon(); - services.AddScoped(); - services.AddSingleton(); - services.AddScoped(); - services.AddScoped(); - - return services; - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/Truncator.cs b/src/cloudscribe.Logging.EFCore.pgsql/Truncator.cs deleted file mode 100644 index 2b9cb34..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/Truncator.cs +++ /dev/null @@ -1,24 +0,0 @@ -using cloudscribe.Logging.EFCore.Common; -using Microsoft.EntityFrameworkCore; -using System.Threading.Tasks; - -namespace cloudscribe.Logging.EFCore.pgsql -{ - public class Truncator : ITruncateLog - { - public Truncator(ILoggingDbContextFactory loggingDbContextFactory) - { - _contextFactory = loggingDbContextFactory; - } - - private readonly ILoggingDbContextFactory _contextFactory; - - public async Task TruncateLog() - { - using (var db = _contextFactory.CreateContext()) - { - await db.Database.ExecuteSqlRawAsync("TRUNCATE TABLE \"cs_SystemLog\"; "); - } - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/VersionProvider.cs b/src/cloudscribe.Logging.EFCore.pgsql/VersionProvider.cs deleted file mode 100644 index a4d21be..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/VersionProvider.cs +++ /dev/null @@ -1,36 +0,0 @@ -using cloudscribe.Versioning; -using System; -using System.Reflection; - -namespace cloudscribe.Logging.EFCore.pgsql -{ - public class VersionProvider : IVersionProvider - { - private Assembly assembly = typeof(LoggingDbContext).Assembly; - - public string Name - { - get { return assembly.GetName().Name; } - - } - - public Guid ApplicationId { get { return new Guid("1ed49467-fbd7-43f4-b8ae-5e78294ed071"); } } - - public Version CurrentVersion - { - - get - { - - var version = new Version(2, 0, 0, 0); - var versionString = assembly.GetCustomAttribute().Version; - if (!string.IsNullOrWhiteSpace(versionString)) - { - Version.TryParse(versionString, out version); - } - - return version; - } - } - } -} diff --git a/src/cloudscribe.Logging.EFCore.pgsql/cloudscribe.Logging.EFCore.pgsql.csproj b/src/cloudscribe.Logging.EFCore.pgsql/cloudscribe.Logging.EFCore.pgsql.csproj deleted file mode 100644 index b2b8663..0000000 --- a/src/cloudscribe.Logging.EFCore.pgsql/cloudscribe.Logging.EFCore.pgsql.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - PostgreSql Entity Framework Core implementation of cloudscribe ILogRepository - 8.3.0 - net8.0 - Joe Audette - cloudscribe;repositories;logging - icon.png - https://github.com/joeaudette/cloudscribe.Logging - Apache-2.0 - - https://github.com/cloudscribe/cloudscribe.Logging.git - git - - - - - - - - - - - - - - - - - - - - diff --git a/src/cloudscribe.Logging.EFCore.pgsql/icon.png b/src/cloudscribe.Logging.EFCore.pgsql/icon.png deleted file mode 100644 index 33d36a2..0000000 Binary files a/src/cloudscribe.Logging.EFCore.pgsql/icon.png and /dev/null differ diff --git a/src/cloudscribe.Logging.NoDb/README.md b/src/cloudscribe.Logging.NoDb/README.md new file mode 100644 index 0000000..f2fbb0f --- /dev/null +++ b/src/cloudscribe.Logging.NoDb/README.md @@ -0,0 +1,10 @@ +# cloudscribe.Logging.NoDb + +NoDb implementation of cloudscribe ILogRepository. + +## Features +- Lightweight, file-based logging repository +- No database server required + +## License +Apache-2.0 diff --git a/src/cloudscribe.Logging.NoDb/cloudscribe.Logging.NoDb.csproj b/src/cloudscribe.Logging.NoDb/cloudscribe.Logging.NoDb.csproj index dd80f71..567c2a3 100644 --- a/src/cloudscribe.Logging.NoDb/cloudscribe.Logging.NoDb.csproj +++ b/src/cloudscribe.Logging.NoDb/cloudscribe.Logging.NoDb.csproj @@ -2,23 +2,25 @@ NoDb implementation of cloudscribe ILogRepository - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;repositories;logging icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git + - + diff --git a/src/cloudscribe.Logging.Web/README.md b/src/cloudscribe.Logging.Web/README.md new file mode 100644 index 0000000..5732b07 --- /dev/null +++ b/src/cloudscribe.Logging.Web/README.md @@ -0,0 +1,10 @@ +# cloudscribe.Logging.Web + +Web UI for cloudscribe.Logging, providing an MVC controller for viewing and managing log data. + +## Features +- ASP.NET Core MVC controller for log management +- Integrates with cloudscribe.Logging repositories + +## License +Apache-2.0 diff --git a/src/cloudscribe.Logging.Web/cloudscribe.Logging.Web.csproj b/src/cloudscribe.Logging.Web/cloudscribe.Logging.Web.csproj index 5fb42e8..c416733 100644 --- a/src/cloudscribe.Logging.Web/cloudscribe.Logging.Web.csproj +++ b/src/cloudscribe.Logging.Web/cloudscribe.Logging.Web.csproj @@ -2,7 +2,7 @@ An implementation of ILogger and ILoggerProvider that logs to the database using a pluggable model supporting multiple data platforms. Also proivides an MVC controller for viewing and managing the log data. - 8.3.0 + 8.4.0 net8.0 Joe Audette true @@ -11,6 +11,7 @@ icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git @@ -18,6 +19,7 @@ + @@ -32,9 +34,9 @@ - - - + + + diff --git a/src/cloudscribe.Logging/README.md b/src/cloudscribe.Logging/README.md new file mode 100644 index 0000000..2c139c8 --- /dev/null +++ b/src/cloudscribe.Logging/README.md @@ -0,0 +1,14 @@ +# cloudscribe.Logging + +An implementation of ILogger and ILoggerProvider that logs to the database using a pluggable model supporting multiple data platforms. Also provides an MVC controller for viewing and managing log data. + +## Features +- Pluggable logging repository (supports EF Core, NoDb, and more) +- Web UI for viewing and managing logs +- Multiple database providers supported + +## Getting Started +Install the NuGet package and follow the documentation at [GitHub](https://github.com/joeaudette/cloudscribe.Logging). + +## License +Apache-2.0 diff --git a/src/cloudscribe.Logging/cloudscribe.Logging.csproj b/src/cloudscribe.Logging/cloudscribe.Logging.csproj index 463855d..b8310cf 100644 --- a/src/cloudscribe.Logging/cloudscribe.Logging.csproj +++ b/src/cloudscribe.Logging/cloudscribe.Logging.csproj @@ -2,13 +2,14 @@ An implementation of ILogger and ILoggerProvider that logs to the database using a pluggable model supporting multiple data platforms. Also proivides an MVC controller for viewing and managing the log data. - 8.3.0 + 8.4.0 net8.0 Joe Audette cloudscribe;logging;database icon.png https://github.com/joeaudette/cloudscribe.Logging Apache-2.0 + README.md https://github.com/cloudscribe/cloudscribe.Logging.git git @@ -17,13 +18,14 @@ + - + diff --git a/update_version.ps1 b/update_version.ps1 index 32134c7..0ed4dd0 100644 --- a/update_version.ps1 +++ b/update_version.ps1 @@ -16,9 +16,9 @@ $directory = "src" # Define the old & new versions -$oldVersion = '8\.2' # slash needed ! -$newVersion = "8.3.0" -$newWildcardVersion = "8.3.*" +$oldVersion = '8\.3' # slash needed ! +$newVersion = "8.4.0" +$newWildcardVersion = "8.4.*" # Get all .csproj files in the directory and subdirectories