Giter Site home page Giter Site logo

drwatson1 / aspnet-core-rest-service Goto Github PK

View Code? Open in Web Editor NEW
73.0 7.0 24.0 489 KB

VS2017/VS2019/2022 project template for ASP.Net 5/6 to create fully functional production ready RESTful services

License: MIT License

C# 100.00%
asp-net-core csharp vs2017 visual-studio project-template restful-api vs2019 vs2022 webapi

aspnet-core-rest-service's Issues

ILoggerProvider not working

ILogger provider is not properly configured and cannot be used

Sample code
public ProductsRepo(
ILogger logger,
ILoggerProvider loggerProvider
)
{
var logger2 = loggerProvider.CreateLogger("abc");
logger.LogCritical("ILOGGER LOG");
logger2.LogCritical("ILOGGERPROVIDER LOG");
}

Output
[FTL] ILOGGER LOG

Expected output
[FTL] ILOGGER LOG
[FTL] ILOGGERPROVIDER LOG

Authentication

Hey, Great stuff. Huge thanks. Do you intend to include authentication with JWT to the project structure someday?

Log DI container creation exceptions

For instance, the following approach would work in the Main() method:
Instead of CreateHostBuilder(args).Build().Run(); do

            Microsoft.Extensions.Logging.ILogger logger = null;
            try
            {
                var hostBuilder = CreateHostBuilder(args);
                var host = hostBuilder.Build();
                logger = (Microsoft.Extensions.Logging.ILogger)host.Services.GetService(typeof(Microsoft.Extensions.Logging.ILogger<Program>));
                host.Run();
            }
            catch (Exception ex)
            {
                logger?.LogCritical(ex, "Unhandled Exception, closing application.");
            }

.env-file don't work for logs

Problem: .env-file don't work for logs

Reason: .env file loaded after serilog read appsetting.config
So I can't write something like "path": "%MY_WAR%/Logs/ReferenceProject.log"

Also, please use uppercase in names of environment variables, AppData should be APPDATA

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.