How to Generate Log Files in Selenium using Log4j API

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 102

  • @Vinodmhetre007
    @Vinodmhetre007 3 года назад

    First I wanted to try this for Java project but since your video was for Maven, I thought to check some other videos. Worst thing was that every single video left me with JUST CONFUSIONS. After spending so much time, I thought lets try with Maven with your video and it worked like charm. What a relief !. It was night mare watching other RUclips videos, really!. Furthermore now I copied the same props file to "src" folder in Java project and now its working there too. I was scratching my head like anything why I dint directly try with Maven in the first place and apply the same for Java project. You are just amazing. THANKS A TON. "I came back home - Naveen AutomationLabs".

    • @factsofallahal-shaheedserv7816
      @factsofallahal-shaheedserv7816 2 года назад

      Your comment tell how important to see this video for correct knowledge, respect for your patience of writing this comment,
      I too watch this because of your comment

  • @sarangmech
    @sarangmech 4 года назад +6

    Very nicely explained. Just a minor feedback - Can you increase the zoom in a bit when you are recording the videos? It is a bit difficult to read the code within eclipse.

  • @anweshkumarnayak2708
    @anweshkumarnayak2708 5 лет назад +1

    Date is showing correct the format is just different, Month/Date/Year is the format and the video recorded was on 11 November 2017 so it is showing 11/01/2017. (I commented in 15:30 secs of watched this video then I saw that you explained why the date is like that).

  • @omkarpotdar2763
    @omkarpotdar2763 2 года назад

    Hey Naveen thanks a lot for covering an extremely useful and important chapter on project & interview perspective. I really appriciated your teaching skills. It's amezing. Keep it up.

  • @minkugrang9524
    @minkugrang9524 6 лет назад +2

    Thanks Naveen.Thanks for sharing your information.

  • @shivanidaftardar1164
    @shivanidaftardar1164 6 лет назад +1

    Thanks for the videos.. you have explained each and every topic in detail.

  • @KrishnaKumar-uq4lk
    @KrishnaKumar-uq4lk 5 лет назад

    Very Nice session. Very informative. Thanks Naveen

  • @pavithrasathyanarayanan4618
    @pavithrasathyanarayanan4618 Год назад

    Hi naveen, log4j is not printing logs with latest selenium version (4.9.0), please correct me if i am wrong

  • @MrMadhur18
    @MrMadhur18 7 лет назад +1

    Hi Naveen awesome videos .. thanks for sharing the knowledge......please come with video for the interview purpose questions

  • @anittatom9304
    @anittatom9304 3 года назад

    Thanks for the video. I just have a question, when I use log4j2.properties, and give the same things as in log4j.properties file, it is not working. Why is it so.

  • @harshitaprasad2236
    @harshitaprasad2236 5 лет назад +1

    Hi Naveen, Thanks for this video. I tired the steps from video but I am not able to see the debug logs in eclipse console nor in log file (like @14:20 in video). As suggested by some folks I used 3.6.0 or 3.5.3 selenium-java dependency too but no luck. Could you please help me out here. My java version is jdk13.0.1. Also to add when i explicitly add the log using logger , only these gets recorded in file & console.

    • @CSOUMYA0427
      @CSOUMYA0427 4 года назад

      I'm also facing same prblem

  • @v2factsand327
    @v2factsand327 2 года назад

    Awesome tutorial sir ji

  • @pragtigupta5675
    @pragtigupta5675 4 года назад

    thanks for the video Naveen, very indetailed description!

  • @factsofallahal-shaheedserv7816
    @factsofallahal-shaheedserv7816 2 года назад

    Sir , what is the short cut for importing all the things at a time @5:27 ?

  • @mohanrammanikandan7939
    @mohanrammanikandan7939 3 года назад

    Thanks, Naveen.
    I have added the jar files of log4j. Add and configure the build path.
    After refresh, it did not create the "application.log" . Can you help to resolve this issue?

  • @alpijain4270
    @alpijain4270 3 года назад

    Thanks Naveen for this video. I can see application log generated but there are errors and also cant see console which executing tests. Could you please advise.

  • @sumit121121
    @sumit121121 4 года назад +1

    Hi Naveen, logs are not generating with selenium server 3.141.0 .however,with older version like 3.5.3 its working fine..it is a bug or some more configurations are required with latest selenium dependencies?

    • @bijitpattanaik6638
      @bijitpattanaik6638 3 года назад

      Any solutions did you get yet? I am also stuck in that issue

  • @albertlopez1705
    @albertlopez1705 4 года назад

    Hi Naveen it was a great video it help me a lot . I have one question . When I run the code in parallel it is logging just one execution not able to see all of them do you have any video for this issue. If you dont have a video do you know any website I could find my solution? thanks.

  • @raghuram7893
    @raghuram7893 3 года назад

    Hi Naveen..Can you please let me know which Design pattern is used by Log4j ..and how can we prove the same ?

  • @nakulsingh8318
    @nakulsingh8318 4 года назад

    this is great vedio bro and good explained...

  • @vaishaliagrawal4781
    @vaishaliagrawal4781 5 лет назад +2

    Hi naveen ... Thanks for videos these are very helpful..
    I have a query this apache log4j will only work with testng or user can run it with java application...
    Thanks in advance

  • @ShubhamGupta-wq4ew
    @ShubhamGupta-wq4ew 5 лет назад

    Hello Naveen, This Video explains to use Log4j api in a Maven project. But as I am a beginner I haven't integrated selenium into my project as of now. Can you please explain How could I use Log4j in my simple Java project in Eclipse to begin with ?

  • @debashisnanda454
    @debashisnanda454 6 лет назад

    hello sir,
    my question is that
    we can get Log4j.properties file's coding from your Git hub but from where we can get these lines of code normally ?
    i mean is there any other process to get these codes? like we are getting any dependency from google ya we have to create these codes ourselves?

  • @kranthikoura411
    @kranthikoura411 5 лет назад

    Hi Naveen,
    I have done everything fine ..test cases are getting generated but no logs are generating.....even tried with diff versions of dependencies....one thing I found is I don't any link bw login test and log4j.properties file....then how come logs get generated for you ...... .plz guide me !

  • @SuperOm12
    @SuperOm12 5 лет назад +1

    Hi Naveen, i want to know why use log4j instead of syso. if i am using system.out .pritntln in every statement under testtcase . is any performance issue?

    • @supratimduttatict
      @supratimduttatict 5 лет назад

      system.out .pritntln does not save logs to file , also , in debug mode, see the detailed level of logs, that is very difficult to achieve in system.out .pritntln

  • @ankitabiswal373
    @ankitabiswal373 4 года назад +1

    THANK U So much naveen..

  • @A_philodendron
    @A_philodendron 4 года назад

    Very well explained 👍

  • @suhail4343
    @suhail4343 6 лет назад

    Hi, Really nice video, got to learn much. I am facing some issue. I am not getting the logs on console and in file. If I create a logger object and the logs which I added are displayed in file and on console.
    What I did is i created a java project, created a resources folder in the project and added the log4j.properties file which you have with same code but when i run it i am not getting any logs in file or in console.

  • @ankitkumarmohapatra3548
    @ankitkumarmohapatra3548 5 лет назад

    May i know from where did you get those data present in log4j.properties file ? Can we do the same with pom.xml file instead of properties file ?

  • @sutharsansadhasivam2401
    @sutharsansadhasivam2401 5 лет назад

    Application.log is file is getting generated but logs are not generated in both console and application.log file. Is there anything else I need to configure

  • @sunilreddymallela
    @sunilreddymallela 7 лет назад +1

    Good Naveen how can we customise the logs in framework level like screen shot path time taken for each click action and after clicking on any link with in home much time the response back to browser from server these types of logs

    • @naveenautomationlabs
      @naveenautomationlabs  7 лет назад

      Hi Sunil, This types of logs will be generated by WebDriver FireEvents. Please refer my tutorial: ruclips.net/video/H2-3w-GQZ3g/видео.html

  • @Sifat1441
    @Sifat1441 6 лет назад +3

    Hi Naveen, I have created the log4j.properties file as you made in src/main/resources package and copied properties file configuration from your Git hub. It's a very small mvn project where I added log4j dependencies and all test cases usually pass. But unfortunately I don't see any log info in my console. Please let me know what happened if you have a chance.

  • @madhurinaik5396
    @madhurinaik5396 4 года назад

    hii naveen i am unable to generate logs in my console ..i am using windows 10
    could u plz tell me how to do it.

  • @shafeekahamed1767
    @shafeekahamed1767 2 года назад

    After upgraded the log4j no logs found in console

  • @shivaprasad1341
    @shivaprasad1341 5 лет назад

    Hi Naveen,
    Can u please make a video on log4j2 version of API framework with an sample example.
    Thanks in advance.

  • @salonabajracharya201
    @salonabajracharya201 4 года назад

    how do i use same log file for different classes?

  • @sathyasachin1696
    @sathyasachin1696 5 лет назад +1

    Hi Naveen: I tried the same steps but I couldn't see logs getting generated for me :( I guess many of us finding this issue when we implement log4j. Can you please help us? thanks in advance.

    • @yogsalunke7260
      @yogsalunke7260 5 лет назад +3

      org.seleniumhq.selenium
      selenium-java
      3.5.3
      import this dependency it worked for me.

    • @mithaleepardeshi
      @mithaleepardeshi 4 года назад

      @@yogsalunke7260 This really worked Thank you.

  • @prosperg186
    @prosperg186 4 года назад +1

    I had to put in these extra lines and then I saw my log file:
    import org.apache.log4j.Logger;
    import org.apache.log4j.PropertyConfigurator;
    Logger Log = Logger.getLogger(LogInTest.class);
    PropertyConfigurator.configure("log4j.properties");

  • @nandiniarumugam9772
    @nandiniarumugam9772 7 лет назад +1

    Thanks for the videos, can you please make videos on Java script executor, cucumber framework, flash/html5 testing too

    • @naveenautomationlabs
      @naveenautomationlabs  7 лет назад +1

      +Nandini Arumugam JavaScript executor video is already there. Cucumber is coming soon.

  • @sutharsansadhasivam2401
    @sutharsansadhasivam2401 5 лет назад +2

    Hi Naveen, I could not get the logs like which you have produced. All I could get is only the text which I written in log.info(). I'm really needed to know how to produce full page of logs like yours. Please help. I even tried even copy paste your entire code. Still I can't

    • @sowmiyaabi8802
      @sowmiyaabi8802 3 года назад

      Have you got any solution for this?

    • @sutharsansadhasivam2401
      @sutharsansadhasivam2401 3 года назад

      @@sowmiyaabi8802 no Sowmiya. I think Mr. Naveen is using some other Jar also. I tried many jar for this. But couldn't succeed. If you find it please let me know.

    • @sowmiyaabi8802
      @sowmiyaabi8802 3 года назад

      @@sutharsansadhasivam2401 yeah, sure

  • @themusicblaze2692
    @themusicblaze2692 5 лет назад

    I am unable to generate selenium back end logs .
    and able to generate debug messages.
    can anyone help me here?

  • @priyankagupta4589
    @priyankagupta4589 4 года назад

    Hi, I am facing error in console. Like could not find template in cache for "extent.ftl"; will try to load it.

    • @tanunjoyroy799
      @tanunjoyroy799 4 года назад

      replace the version of selenium
      3.5.3
      in pom.xml
      it will work

  • @yugandherakkunuru96
    @yugandherakkunuru96 6 лет назад

    Hello Naveen, I was able to log the info, warn messages, however I am not able to see the selenium server logs getting logged, do I have to setup additional configurations?

    • @yugandherakkunuru96
      @yugandherakkunuru96 6 лет назад +1

      With selenium (3.13.0) I am not able to see the selenium server logs, however it is working with selenium 3.5.3.

  • @SRohithKumar1977
    @SRohithKumar1977 6 лет назад

    Hi, Naveen can you share the logj.propertiesfile Please.....

  • @thirumuruganganesan5234
    @thirumuruganganesan5234 6 лет назад

    Hi Naveen, I have followed the same steps as specified in the Log4J video. But unfortunately I don't see any log info in my console. Please let me know what happened if you have a chance.

    • @shoyebkhatib8084
      @shoyebkhatib8084 5 лет назад

      Hey Naveen, same issue for me, can u please let me know

  • @yogsalunke7260
    @yogsalunke7260 5 лет назад +2

    Hi Naveen, Thanks for this awesome video. But in my case i have two files under resources folder one is xml file and another is log4j.properties (this is the proejct where i hv implemented framework concepts). but here i don't see any logs being generated. I tried creating another project and tries to implement it there it worked there. Can you please help me out here.
    I got the resolution after changing my java dependency to
    org.seleniumhq.selenium
    selenium-java
    3.5.3

    • @arunkumar369
      @arunkumar369 4 года назад

      I got it the same way ..Thank you

    • @Last_30_Seconds
      @Last_30_Seconds 2 года назад

      Hii it's not working with selenium 4.1 version please let me know of u have any idea actually I'm unable to generate any log file

    • @praneethchakri7052
      @praneethchakri7052 2 года назад

      @@Last_30_Seconds Hi Salman,
      Same here, I had sample tests..created this log4j file but after running its not generating any logs
      any resolutions ?

  • @phaneendranv
    @phaneendranv 6 лет назад +1

    getting warning messages as,
    log4j:WARN No appenders could be found for logger (com.delta.qa.base.BaseClass).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    Copied under src/main/java/
    pls let me know how to resolve it.

  • @anamikad9042
    @anamikad9042 6 лет назад +1

    Hi Naveen,
    Previously i was able to generate application.log file. However recently when I run my TestNG class or TestNG suite, I am unable to generate console and file logs.
    Following are the configurations made:
    1. Added log4j dependency in pom.xml
    2. Created log4j.properties under src/main/resources
    Is there anything which I have missed out. Please guide.

    • @sathyasachin1696
      @sathyasachin1696 5 лет назад

      Even I'm facing same issue, but I'am trying to use it for mobile application automation. Does it work only for WebApp?

    • @sureshhajra
      @sureshhajra Год назад

      Did you refresh the project ?

  • @utharsmart7702
    @utharsmart7702 4 года назад

    Bro pls change ur device text bigger for ur upcomming videos

  • @sb7355
    @sb7355 5 лет назад

    Hi Sir, could you please provide this code.

  • @adnanfaisal1085
    @adnanfaisal1085 4 года назад +1

    Tried it exactly as shown. No logs came.

  • @rashmichethan
    @rashmichethan 6 лет назад

    Hi Naveen, I am not able to generate the logs either, after adding 2 required configurations :
    1. Added log4j dependency in pom.xml
    2. Created log4j.properties under src/main/resources
    3. And also added the standard properties from your github repository for log4j.properties
    Can you please tell, if any configuration or jar mismatch happened ? Appreciate your response.

  • @prabakarm5025
    @prabakarm5025 6 лет назад

    nice

  • @2mahender
    @2mahender 6 лет назад

    can u pplz give yout telegram chat name, the link above not working
    or else give whats grp

  • @chetanyadav708
    @chetanyadav708 4 года назад +1

    gold !!!

  • @benitopaul4723
    @benitopaul4723 2 года назад

    Are you pronouncing as @ as @therrate..
    Cant understand 😒

  • @SuyashNande
    @SuyashNande 6 лет назад +1

    zoom your video, if you are teaching someone.

    • @naveenautomationlabs
      @naveenautomationlabs  6 лет назад +1

      Hi, better u watch these videos in full screen mode on your laptop. btw thanks for letting me know how to teach someone.

    • @PramodSingh-dn1vk
      @PramodSingh-dn1vk 6 лет назад +1

      I agree with @Suyash Nande.
      @Naveen AUtomationLabs- Inspite of using 1080 resolution, full screen on laptop the font size is very small and uncomfortable to read.
      It is good feedback for your videos, I hope you take it in positive way and take care of this in upcoming Videos.

    • @Maheshreddykadapa
      @Maheshreddykadapa 6 лет назад +3

      if some is really interested in learning, pause the video and write it on ur paper. don't give suggestions.

    • @bharathkoneru4008
      @bharathkoneru4008 5 лет назад +6

      @@naveenautomationlabs Naveen we are much comfortable with the font as well..No issues...Sharing itself is a huge bonus and great gesture 4m you...We are extremely happy with everything that is coming 4m you...Keep going Champ🤘👍

    • @yuvrajsaini732
      @yuvrajsaini732 5 лет назад +3

      I think if you have the issue, please raise this as request not the right language, he is doing it for free

  • @ayushisrivastava4001
    @ayushisrivastava4001 2 года назад

    Hi Naveen, I have followed the same steps as specified in the Log4J video. But unfortunately I don't see any log info in my console. Please let me know what happened if you have a chance.

    • @nayanagopinath669
      @nayanagopinath669 2 года назад +1

      Hi Ayushi, log4j is deprecated and we have to use log4j2 and property file name also should be log4j2.properties.

    • @ayushisrivastava4001
      @ayushisrivastava4001 2 года назад

      @@nayanagopinath669 thanks Nayana🤙🏻