drwatson1 / aspnet-core-rest-service Goto Github PK
View Code? Open in Web Editor NEWVS2017/VS2019/2022 project template for ASP.Net 5/6 to create fully functional production ready RESTful services
License: MIT License
VS2017/VS2019/2022 project template for ASP.Net 5/6 to create fully functional production ready RESTful services
License: MIT License
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
Hey, Great stuff. Huge thanks. Do you intend to include authentication with JWT to the project structure someday?
Hi, is it possible to create a new project, with the dotnet new, based on this template?
Thank you.
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.");
}
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.