Fullstack developer for a midsized telecommunications company located in southern Indiana. Programming languages and compilers enthusiast. Striving to get 1% better every day.
I would appreciate that! Logging is the one significant piece my app needs that I can't figure out how to set up. It's a work project.
I know, I know, building a work project on a pre-release version of .NET probably wasn't the brightest idea, but since it's an LTS it made sense to me since it will be supported for a longer time than .NET 5.
The sticking point is I can't figure out where to put UseSerilog, or what else to use if that method isn't going to work.
Fullstack developer for a midsized telecommunications company located in southern Indiana. Programming languages and compilers enthusiast. Striving to get 1% better every day.
Fullstack developer for a midsized telecommunications company located in southern Indiana. Programming languages and compilers enthusiast. Striving to get 1% better every day.
Fullstack developer for a midsized telecommunications company located in southern Indiana. Programming languages and compilers enthusiast. Striving to get 1% better every day.
Fullstack developer for a midsized telecommunications company located in southern Indiana. Programming languages and compilers enthusiast. Striving to get 1% better every day.
I would appreciate that! Logging is the one significant piece my app needs that I can't figure out how to set up. It's a work project.
I know, I know, building a work project on a pre-release version of .NET probably wasn't the brightest idea, but since it's an LTS it made sense to me since it will be supported for a longer time than .NET 5.
The sticking point is I can't figure out where to put
UseSerilog
, or what else to use if that method isn't going to work.I did same thing with .NET Core RC1 :) It was very risky, but we did the project successfully.
This code works for me and try it
dev-to-uploads.s3.amazonaws.com/up...
Well, it doesn't generate an error or crash, so that's good. When I run
dotnet run
it hangs, but when I rundotnet build
it runs without a hitch.Sorry for being such a n00b but this is literally my first .NET project so everything is new and uncertain.
I figured it out - I forgot to tell it in
appsettings.Development.json
where to output the log info. Silly beginner mistake.Now how do I actually access the logger and use it? Do I need to create an instance somewhere or set it up for dependency injection?
No, just inject I
ILogger
into classes you want to log data.Got it working! Thanks for taking the time to help me out.