Nick, you can also add serilog as a default logging provider into Microsoft extensions logging. So you won’t have to change from the ms implementation of Ilogger into serilog logger and continue to record your logs in the serilog format.
@@infotips2475 Here is a minimal example in dotnet 6 Minimal API using Serilog; var builder = WebApplication.CreateBuilder(args); builder.Host.UseSerilog((context, config) => { config.WriteTo.Console(); }); var app = builder.Build(); app.MapGet("/", (ILogger _logger) => { _logger.LogWarning("TEST"); return "Hello World!"; } ); app.Run(); You must install Serilog.AspNetCore nuget package for this to work.
Thank you for this video. TIP: you can search trough commands history in terminal emulator with CTRL+R and then typing, way faster that up/down arrows.
Thank you - I have been trying to get started with elasticsearch logging for a while without success. This was the video where I finally got it :) Great video, and just the right level of detail to your explanations.
Nick, you are simply awesome, i don't it is coincident or what, your all videos are linked to my current work like. Net core, serilog, reflections, redis cache, elastic search, system. Text.Json, logger etc etc... Thanks a lot for helping in directely us to building a Product
Hello, first of all congratulations for your videos, they are simple and very clear and always touch on very interesting topics, also I really like your way of explaining, you can see that you love what you do and that you do it well Today I saw this video, and it would be nice if you made one on elastic stack and how would you structure your logs (real cases) in case of using filebeat. Great, keep it up
Awesome! Thanks!. Waiting for the Elasticsearch tuto. I have a question for you. Does this logging to elasticsearch have a retry in case the service is down or in case of error trying to log?
This is great - thank you. I'm really interested in trying it out myself, but I came unstuck with the docker/yaml stuff. I can't get hold of your repo as there seems to be a problem with the invite system. Can you help?
Thanks for another great video. Really learning a lot from you. First it's freaking awesome that you can have all that functionality with so little code, awesome. I would like to have Serilog to log to different devices dependent on the environment the program are running in. localmachine to console, TEST, QA and PROD to Elastic. What would be the best approach?
I tried to follow the steps but finding difficulty because elasticsearch version 8 has introduced major changes perhaps. Kindly post a video complying new version to use Serilog with elasticsearch
Great content. Is it possible to configure a retention policy of the logs in elastic search? So like if you want to keep only the last 2 months of logs.
This is great tool, is it possible to replace with this tool the logging from SQL (through SQL trigger, during create, update, and delete transaction)? TIA :)
nice and practical tutorial. However, I'm not seeing my index pattern in Kibana. I followed the exact steps, bus used the official E-L-K docker containers
Logging not working when i publish it to IIS, but work normally locally, there is no restriction in network, how can i solve it? maybe i missed some config for production?
Hi. Why when using method logger.information("very bad request") or logger.error("something bad") does not display my message in kibana? I got message "request finished http 1.1 post... " MessageTemplate {HostingRequestFinished:l}
one container, elasticsearch doesn't work for me for some reason. It starts and runs for a bit but then stops with "ERROR: Elasticsearch exited unexpectedly". Nick, do you have the sourcecode available somewhere perhaps? (Although I'm pretty sure I copied correctly.)
Nevermind, I had a "too low max virtual memory" issue. To fix, run: > wsl -d docker-desktop > sysctl -w vm.max_map_count=262144 > exit (to exit the wsl)
Nick, you can also add serilog as a default logging provider into Microsoft extensions logging. So you won’t have to change from the ms implementation of Ilogger into serilog logger and continue to record your logs in the serilog format.
where can i get an example ?
@@infotips2475
Here is a minimal example in dotnet 6 Minimal API
using Serilog;
var builder = WebApplication.CreateBuilder(args);
builder.Host.UseSerilog((context, config) =>
{
config.WriteTo.Console();
});
var app = builder.Build();
app.MapGet("/", (ILogger _logger) =>
{
_logger.LogWarning("TEST");
return "Hello World!";
}
);
app.Run();
You must install Serilog.AspNetCore nuget package for this to work.
Very nice. Excited for the full elastic search video
Thank you for this video.
TIP: you can search trough commands history in terminal emulator with CTRL+R and then typing, way faster that up/down arrows.
log templates with custom properties are working when using ILogger interface as well
I really appreciate the way you explain things, keep up the good work. thanks
Thank you - I have been trying to get started with elasticsearch logging for a while without success. This was the video where I finally got it :) Great video, and just the right level of detail to your explanations.
Excellent explanation. Thank you Nick.
Nick, you are simply awesome, i don't it is coincident or what, your all videos are linked to my current work like. Net core, serilog, reflections, redis cache, elastic search, system. Text.Json, logger etc etc... Thanks a lot for helping in directely us to building a Product
Hello, first of all congratulations for your videos, they are simple and very clear and always touch on very interesting topics, also I really like your way of explaining, you can see that you love what you do and that you do it well Today I saw this video, and it would be nice if you made one on elastic stack and how would you structure your logs (real cases) in case of using filebeat. Great, keep it up
Thanks and great job. waiting for your next Elastic search video
These videos are great! I am learning so much!
Nick, another perfect video
Thank you so much!
You're the guy!
This is really great, thank you for all the videos you make - please never stop making videos and remember: keep coding :)
Thank you! Very useful
Awesome video, thanks for sharing.
So useful! Thanks 👍🏻
Awesome! Thanks!. Waiting for the Elasticsearch tuto. I have a question for you.
Does this logging to elasticsearch have a retry in case the service is down or in case of error trying to log?
Thanks a lot. Really useful knowledge 👍
This is great - thank you.
I'm really interested in trying it out myself, but I came unstuck with the docker/yaml stuff. I can't get hold of your repo as there seems to be a problem with the invite system. Can you help?
very nice. Thanks for sharing.
super cool. Thanks for it.
What are the nuigets that you used?
We're already doing this in all of our applications internally :D
is it free please? Do you need to pay for any of the elastic search or Kibana?
@@sunnyokoro it’s completely free
nice video,
really useful video!!!!!
Where is the ElasticSearch video mentioned in this? Was as it ever uploaded? Couldn’t find it with search
Thanks for another great video. Really learning a lot from you.
First it's freaking awesome that you can have all that functionality with so little code, awesome.
I would like to have Serilog to log to different devices dependent on the environment the program are running in.
localmachine to console, TEST, QA and PROD to Elastic.
What would be the best approach?
instablaster.
Would be great if you would cover the NEST library as well
amazing man
I tried to follow the steps but finding difficulty because elasticsearch version 8 has introduced major changes perhaps. Kindly post a video complying new version to use Serilog with elasticsearch
Can you use that with the Serlilogs Log.Error also?
you omitted logstash, how would you refactor the code to support logstash? Thanks for the tutorial.
Great content. Is it possible to configure a retention policy of the logs in elastic search? So like if you want to keep only the last 2 months of logs.
Hi Nick, As you said you are going to create a video on Elastisearch, when you are planning to upload that?
Have you tried elmah.io? How does it compare?
Hi Nick, thanks for the video. Are you still planning on doing a video on ElasticSearch only (or maybe OpenSearch)? That'd be awesome:)
This is great tool, is it possible to replace with this tool the logging from SQL (through SQL trigger, during create, update, and delete transaction)? TIA :)
nice and practical tutorial. However, I'm not seeing my index pattern in Kibana. I followed the exact steps, bus used the official E-L-K docker containers
Logging not working when i publish it to IIS, but work normally locally, there is no restriction in network, how can i solve it? maybe i missed some config for production?
Nick Please do a tutorial on MS Search integration.
4 years ago you promised Elasticsearch video, 4 years later I can't find it. 🙂
Nice video. I have one question. How Kibana accessing Elastic search DB. where you have configured it
That is part of the docker-compose that I'm using
Awesome !!
my elastic server is remotely hosted and need username and password to authenticate, where do i specify these credentials in my .net core application?
how to add authentication
Thanks for video, but I find the Index Pattern tab
in case someone faces the issue with elastic service run - add "discovery.type=single-node" to the elastic service's environment
What does this have over just using Serilog and Seq? What did Elastic and Kibana get over this?
I've seen Seq at scale and it just doesn't play nicely.
How can we use Elasticsearch/Serilog when API is hosted on Azure?
We do AppInsights/Serilog with stuff hosted in kubernets/azure, so definitely
Hi. Why when using method logger.information("very bad request") or logger.error("something bad") does not display my message in kibana? I got message "request finished http 1.1 post... "
MessageTemplate {HostingRequestFinished:l}
one container, elasticsearch doesn't work for me for some reason. It starts and runs for a bit but then stops with "ERROR: Elasticsearch exited unexpectedly".
Nick, do you have the sourcecode available somewhere perhaps? (Although I'm pretty sure I copied correctly.)
Nevermind, I had a "too low max virtual memory" issue. To fix, run:
> wsl -d docker-desktop
> sysctl -w vm.max_map_count=262144
> exit (to exit the wsl)
thanks
Nick I am still waiting the elasticsearch video XD.
Well, shit 😂
Not a bad idea, keep it in mind for the future, keep doing such an excellent work, a hello from a fan from Cuba
Personally I reckon having the configuration all coming from appsettings is a better approach
It's definitely a more convenient approach but it is also definitely not a secure one