System Design Logging Framework | Implementing Logger | System Design Interview Low Level| logging
Ғылым және технология
In this video I have implemented a logging framework. Loggers are very common asked low level system design question. There are multiple design patterns that can be used to create this framework. Here I have used 3 Object Oriented Design pattern and coupled them to work together.
Logging is a very common phenomenon in computer science and in any application.
complete code is added in my git repo.
You can buy us a coffee at : www.buymeacoffee.com/thetechg...
system design: • System Design | Distri...
DS for beginners: • Arrays Data Structures...
leetcode solutions: • Leetcode 84 | Largest ...
github: github.com/TheTechGranth/theg...
facebook group : / 741317603336313
twitter: / granthtech
Пікірлер: 38
Complete code can be downloaded from : github.com/TheTechGranth/thegranths/tree/master/src/main/java/SystemDesign/LoggingFramework
@prince26902690
2 жыл бұрын
Don't you think this will print multiple levels if you log debug? we only need one logger
Thank you for your contributing to the community. I have more than I hope from you
Thanks for such an awesome video explaining mapping of design patterns applications with a relatable example!
@TheTechGranth
2 жыл бұрын
Glad it was helpful. Do like and subscribe and share with others 🙂
Thank you so much 'The Tech Granth'
Quite informative ! Good way of thinking about related design patterns.
@TheTechGranth
2 жыл бұрын
Glad it was helpful. Do like and subscribe and share with others 🙂
This is quite informative with very nice demo on use of design patterns. Thanks!!! Nice job 👏
@TheTechGranth
2 жыл бұрын
Glad it was helpful. Do like and subscribe and share with others 🙂
great explanation. really liked the way the problem is approached.
Best explanation of logger , and great usage of design pattern
From past few days I am avidly following videos in your channel . This channel really comprehensive ,beginner friendly and not having any paid courses or ads like other big youtubers .... Simply #noShitTotallyHit. I hope you will continue this LLD series weekly
@TheTechGranth
2 жыл бұрын
Hope content was helpful. Do like the videos and subscribe and share with others 🙂
Excellent explanation and easy to understand. Kudos to you Bro 👍👏
Really Helpful!
very useful use case which covers Singelton, chain of responsibility and observer pattern
Should we also consider to have a "String absolute_filename" when we are calling the fileObserver ? In which file will the data be logged ?
This was very detailed explanation of logging system, really helped, thanks
@TheTechGranth
Жыл бұрын
Do like, subscribe and share with others
Excellent
Thank you :)
@TheTechGranth
2 жыл бұрын
Hope it was helpful. Do like and subscribe and share with others 🙂
@thetechGranth Great video. Can you make system design video on tagging system,
Very good explanation :) But I don't think we need chain of responsibility design pattern here, we can use Factory pattern directly to get the object of the required Logger as we only need one logger at a time.
@prince26902690
2 жыл бұрын
I also agree. Not sure why we need chaining here? we only need to log one level at time
@bhawanasahu3000
6 ай бұрын
I answered the same in one of my interview, but interviewer restricted his expectations to chain of responsibility pattern & I never understood why.
@FusionArcs
6 ай бұрын
@@bhawanasahu3000 let's take example of log4j, we can enable certain log level in the system like ERROR or INFO etc, this is how the error levels are defined ALL Now you can see that chain of responsibility comes in handy here, lets say I have used warn as log level in log 4j and in code i have different logs like debug, info, error etc lets take error, it will go to all handlers and check what log level is enabled e.g. it will first go to debug handler, is it enabled, no, then go to next info and next warn, okay warn is enabled but the log level to be printed is error, then it will move to next handler i.e. error okay now it matches the log level to be printed and also at the system level warn is enabled and error handler is eligible for printing this log There is a order of execution here where the request may or may not be fulfilled based on what log level is enabled and the order which the request should be served is defined by the chain of responsibility pattern i.e. ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF
@ankitpersie1
2 ай бұрын
Yes, absolutely.If the root level is ERROR, we expect it to display log.info() and log.error() statements only in actual logging framework.This can be easily handled by individual loggers by comparing their actual levels with root level.There is never a delegation needed.
@vaibhavghadge4057
20 күн бұрын
Yes, I also think the same why do we need a chain of responsibility here? does anyone get a solution?
but in actuall logger, you set the logging level first and based on that level specific data is displayed
I got same question in NI LLD interview
I think your logger class breaks " OPEN AND CLOSED PRINCIPLE" because if there are any other type of log files, then u have to create methods for them. If I wrong, then please correct me. Also we can use factory design pattern instead of chain responsibility pattern.
bro you literally made a simple design more complex and mess
couple of issues with the design. We don't need chain of responsibility here. How to make log levels configurable so let us assume if we want to only print logs above INFO level.
@Paradise-kv7fn
2 жыл бұрын
COR fits nicely here actually. For configuration part, we can maintain a threshold value that the user can configure and add a check for this before printing(perhaps the abstractlogger)
Very good explanation :) But I don't think we need chain of responsibility design pattern here, we can use Factory pattern directly to get the object of the required Logger as we only need one logger at a time