
Learn what logs are and why they are useful for back-end visibility, including capturing exceptions, keep-alive signals, and analytics, with guidance on filtering by log levels.
Explore log levels, including debug, information, warning, error, and critical, and learn how to apply each level's purpose and conventions for end-to-end logging.
build a server-side stock price app that retrieves stock prices on user request and learn end-to-end logging from docker to grafana using gelf logs, logstash, mysql, and alerts.
For this course you'll need to install Docker, C# and VSCode.
Bellow are the links for everything you'll need.
Feel free to jump into the forum if you find any issues!
Obtain an ILogger from the DI container in program.cs via app.services.getService and log that the application has started before app.run, noting its blocking behavior.
Refine nlog configuration to show only json logs, implement a memory cache via the decorator pattern for stock price retrieval, and integrate with dotnet di and the scruter package.
Wrap your code in a docker container by creating a dockerfile and dockerignore, build a lean image, map ports to the host, and view logs via stdout.
Create a Docker Compose file to run multiple containers and connect them, and learn how Docker Compose builds and runs the app with the image, showing logs in the terminal.
Explore how Docker logs work by shipping container stdout to the host and to a GELF destination, without changing the software, using Docker Compose and log configuration.
Configure logstash to receive GELP input on UDP port 12201, map this UDP port in docker-compose, and run the application alongside logstash to stream logs to the console.
Add a filter in Logstash to parse the message as JSON, enabling per-attribute handling, and test with HTTP input and curl to verify keys appear in the stream.
Refine Logstash filters by using prune and whitelist JSON field names, align variables with explicit JSON names, and test changes with curl to view only the selected keys.
Install mysql under docker, add a persistent volume to the logstash docker compose, run it, then connect to the docker terminal to run sql commands as the database comes up.
Add Grafana as a service to the logging Docker Compose, expose port 3000, and mount storage to enable dashboards, tables, graphs, and alerts from multiple data sources after admin/admin login.
Create an alert for high response time in a Grafana panel, configure last as the reduction, set evaluation every 10 seconds, and test firing with thresholds and email notifications.
Hi there! My name is Javier
I’ve been working as a software engineer for more than ten years.
I have a sweet spot for logging and I think it’s a very important aspect of software that mostly gets overseen.
In the last few years I’ve been deep diving into logging, and learned how to correctly write, deliver and analyze them.
At the end of this course you’ll have a working .Net API Server shipping Logs to a Logstash pipeline and being displayed using Grafana Dashboards.
Let’s break this down.
In this course you’ll learn:
How to write logs in C# .Net
Even if C# isn’t your daily programming language, everything I’ll show will be easily projectable to any other programming language and framework.
Handling logs when working with Docker Containers - We’ll see how Docker handles the standard output (stdout), how to use docker commands to see the logs and how to configure Docker to ship the logs to wherever we want to.
Working with Logstash - A processing pipeline for logs. We’ll see what Logstash is, how we can run it and configure it.
Finally, we’ll learn how to use Grafana to display the data, creating dashboards and panels.
The data will come from a SQL database that will be popularized using Logstash.
We’ll see how easy it is to create alerts on Grafana to notify when something happened according to our logs!