Java for Beginners 13 - Logging using slf4j and logback

Sdílet
Vložit
  • čas přidán 8. 09. 2024
  • In this episode I explain how to do logging in Java using slf4j and logback. Go to java8course.com for additional material like the slides, a pdf, exercises and other videos.

Komentáře • 62

  • @marosero
    @marosero Před 6 lety +2

    Thank you for great and brief overview about java logging and logback functions. Great lessons with straight and clear descriptions and examples.

  • @harishdaggupati8292
    @harishdaggupati8292 Před 3 lety +1

    What an excellent tutorial, very informative and excellent presentation. Thank you for the video

  • @MyoMang746
    @MyoMang746 Před 7 lety +3

    Good Lecture!
    and thanks for subtitles

  • @BURN-ADDiCT
    @BURN-ADDiCT Před 4 lety +1

    In Lesson 6, you mention that you advise beginners to start with a text-editor so we get used to JAVA code... that was not so friendly advice.
    I struggled for about 4 days trying to use slf4j and getting errors like "unable to instantiate an Appender of type 'ch.qos.logback.ConsoleAppender'... DynamicClassLoadingExcerption"
    That type of error is hard to troubleshoot for a beginner. I downloaded Eclipse after giving up on logback in Sublime.
    I still had to troubleshoot (in the Eclipse IDE), but at least it took about 2 hours to find the solution this time.
    Starting with text editor is bad advice. IDE's are the way to go.

    • @MarcusBiel
      @MarcusBiel  Před 4 lety +1

      Working with a text editor is hard. But it will make you learn and understand Java much more deeply. I never said it was easy. This is tough. Tough is how we learn fast! :) However, on this advice I am not so sure about anymore... My mistake was that I didn't use a text editor myself to show you how...

    • @BURN-ADDiCT
      @BURN-ADDiCT Před 4 lety

      @@MarcusBiel Yes, please... I'm not at all saying that using a text editor is bad... But I am saying that if I spend 4 days trying to find the reason why 'ConsoleAppender' is not being found on my system, then it's very discouraging.
      As a complete beginner, I didn't even know that "com.benedict.javalessons" means there's a folder called "com" and a folder inside it called "benedict". I didn't know it until I was reading different documentation and they were telling me to search the target folder (which I didn't have). It's frustrating, it made me start blaming my computer and my operating system without realizing what the problem was.
      Even now, I haven't found the solution to that problem on logback with slf4j... I am now using the log4j because the ConsoleAppender there is simpler to troubleshoot.
      I appreciate the fact that I am learning (especially since some of my problems forced me to learn what a debugger is, what a compiler is and why we need a linker) but it is frustrating to troubleshoot before even writing the first software.

  • @michamazurkiewicz80
    @michamazurkiewicz80 Před 4 lety +2

    that part about chip log blowed my mind hahaa :D

  • @tinybigstore
    @tinybigstore Před 4 lety

    Just great, nice and easy way of teaching, detailed.

  • @MarcusBiel
    @MarcusBiel  Před 9 lety +5

    In this episode of my free Java video course I would like to introduce you to logging. Actually, what is logging? First of all, let’s tell you what my idea is. I have prepared this little test here. I have prepared a little class “carService”. I wanted to process this string “BMW” or Bimmer and in the class, this class so far is empty. My idea is I want to be notified in some way like a print out on the console into a file, the database or maybe even an email or something so I want to be notified in some way. I want to monitor if someone calls this method so that I later on can go through all the calls and can see if something happened. For example if my system was hacked I could go through file and see what time, what happened and then analyze it. That’s the idea. The way this is done is by logging...

  • @hungphan
    @hungphan Před 6 lety +2

    Your teaching method is extremely easy to understand. Thank you so much.

  • @sakshibansal1436
    @sakshibansal1436 Před 6 lety

    Thank you ! Very useful information you have provided.

  • @gvdutra87
    @gvdutra87 Před 6 lety

    Dude, Thanks so much, the best part for me is the beginning of the video! I like to know where things start ... soooo good :D...

  • @robotronix420
    @robotronix420 Před 2 lety

    Great video explaining logger

  • @kirankumar6501
    @kirankumar6501 Před 7 lety +1

    Nice tutorial Marcus Biel....

  • @siddha07
    @siddha07 Před 7 lety

    Thanks Marcus for the explanation on logback. It would have been good if you have covered what are all the advantages of logback over log4j.

    • @MarcusBiel
      @MarcusBiel  Před 7 lety

      The purpose of the video was to explain logging, using the state of the art "tools". What purpose is it to waste time comparing log4j to logback - logback is its sucessor, period. If you need such a comparison, you should be able to find a lot of these online :)

  • @MuztabaHasanat
    @MuztabaHasanat Před 7 lety +1

    thanks, very informative.

  • @piskunyevhen3920
    @piskunyevhen3920 Před 3 lety

    Thank you for tutorial!

  • @oskaldas
    @oskaldas Před 7 lety +1

    Quite an interesting beginning of your video, I expected to learn something useful about slf4j logging, which I did, nut I also leaned new stuff about sailing history :)

  • @adriansalabanzi2250
    @adriansalabanzi2250 Před 5 lety +1

    Thumbs up!

  • @vanweyden
    @vanweyden Před 4 lety +1

    Thanks a lot!

  • @paulmanuilenko7894
    @paulmanuilenko7894 Před 6 lety

    Thank you very much for awesome video and explanation.
    Special thanks for the easy understandable speech. :)

  • @jaswalkiranavtar
    @jaswalkiranavtar Před 6 lety

    Nice intro level video for beginners

  • @rafaeleduardo7467
    @rafaeleduardo7467 Před 6 lety +1

    Muito boa explicação parabéns !

  •  Před 9 lety +1

    Great explanation of logging rules and configuration with logback, thanks!

    • @MarcusBiel
      @MarcusBiel  Před 9 lety

      Thanks, Kamil! Anything I could improve?

  • @coupleonthecliff7010
    @coupleonthecliff7010 Před 8 lety +1

    Great explanation

  • @henryyoo8707
    @henryyoo8707 Před 7 lety +1

    Thanks for your great explanation :-)
    By the way, what is that window on the right side when you execute test?
    In my environment, I can see just log messages.

    • @MarcusBiel
      @MarcusBiel  Před 7 lety

      What kind of environment are you using? Eclipse maybe? In this video, I am using IntelliJ IDEA 14 Ultimate. If you refer to the green bar - it's just the "run view" that appears when I execute a test.

    • @henryyoo8707
      @henryyoo8707 Před 7 lety

      Thanks for replying. I'm using IntelliJ 2016.3 Ultimate so when I execute tests I can see the logs and the green bar. But as in the video (time - 19:31), there's an table under the green bar. The table shows some useful information to users. But I've never seen this before. So I want to know what is that :-)

    • @MarcusBiel
      @MarcusBiel  Před 7 lety

      In the video at 19:31 you can see a blue settings wheel in the bottom left corner, in the run view. Click on it, then select "Show Statistics". That should do the trick - let me know.

    • @henryyoo8707
      @henryyoo8707 Před 7 lety

      I found a option "show inline statistics" in the settings drop-down menu. But it doesn't show me a table like that. I think there's some modifications after some version updates. IntelliJ official reference also says there's an option as you mentioned but it's not.
      Anyway, you helped me a lot. Thank you very much :)

    • @MarcusBiel
      @MarcusBiel  Před 7 lety +1

      I don't know about IntelliJ 2016.3 Ultimate, maybe there are differences? Contact their support, maybe they can help you?

  • @mortenwallinjensen
    @mortenwallinjensen Před 4 lety

    Ahoy you
    country choppy. We still use books for logging in the navy. ;-)

  • @harishchowdarysure8858

    sir why all the collection classesimplementing clonable interface?

    • @MarcusBiel
      @MarcusBiel  Před 8 lety

      czcams.com/video/0_V-z6QcaWc/video.html

  • @VitiliKo
    @VitiliKo Před 7 lety

    Do you have a tutorial, where you use the FileAppender?

    • @MarcusBiel
      @MarcusBiel  Před 7 lety +1

      Sorry, currently not. This is my only tutorial about logging so far.

    • @RahulJoshi-di3mm
      @RahulJoshi-di3mm Před 5 lety

      Refer logback.qos.ch/manual/index.html for FileAppender.

  • @announ06
    @announ06 Před 7 lety

    How the logback.xml is created?

    • @MarcusBiel
      @MarcusBiel  Před 7 lety

      it's just a text file. You can just open a new file, put this content into it, and save it as "logback.xml".

    • @jinhe4438
      @jinhe4438 Před 4 lety

      @@MarcusBiel I have the same question before seeing ur replay

  • @iMoe400
    @iMoe400 Před 3 měsíci

    "I want to process this String: "BMW" or "bhmhwh""
    What does that even mean xd

  • @October-fo3bz
    @October-fo3bz Před 6 lety +1

    thx but you talked a lot to explain something quite simple?

    • @MarcusBiel
      @MarcusBiel  Před 6 lety +2

      Great if it is simple for you, but, as you can see here in the comments, it's not so simple for everyone! :)

    • @October-fo3bz
      @October-fo3bz Před 6 lety

      True I guess.

  • @alexeystaroverov4804
    @alexeystaroverov4804 Před 6 lety

    dude, it's too few stuff for 30 min talking...

    • @MarcusBiel
      @MarcusBiel  Před 6 lety +1

      Dude, there are about 13k people that would disagree with you. Also, I don't really get your point. I do my Java tutorials with a lot of passion in my free time - no one forces you to watch them.

    • @alexeystaroverov4804
      @alexeystaroverov4804 Před 6 lety

      I liked your video BTW, but I believe u can more!

    • @MarcusBiel
      @MarcusBiel  Před 6 lety

      Great that you have confidence in my skills! ;)