How to Generate Log Files in Selenium using Log4j API

Ғылым және технология

How to generate Logs using Apache Log4j API in Selenium:
Learn:
How to Generate Log Files in Selenium WebDriver
Selenium log file
log4j properties in selenium webdriver
Download log4j jar for selenium
log4j jar for selenium webdriver
Selenium webdriver console log
=======================================
Log4j API, Code Base GIT URL:
github.com/naveenanimation20/...
========================================
Subscribe to the channel, and press bell icon to get some interesting videos on Selenium and Automation:
kzread.info%20Au...
Join Facebook Group:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram Group:
t.me/joinchat/COJqZQ4enmEt4JA...
~-~~-~~~-~~-~
Follow my Site/Blog: www.naveenautomationlabs.com
========================================================
Please watch: "Selenium & Automation Interview Preparation - By Naveen AutomationLabs"
• Selenium & Automation ...
~-~~-~~~-~~-~ Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
kzread.info%20Au...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/COJqZUPB02r5sB7...
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautomationlabs.com/p...
API Course: www.naveenautomationlabs.com/p... ➡️Get Our Courses✔️
📗 Get My Paid Courses at
Paid courses (Recorded) videos:
Java & Selenium Course: www.naveenautomationlabs.com/p...
API Course: www.naveenautomationlabs.com/p...
-------------------------------
✔️SOCIAL NETWORKS
Facebook: / naveenqtpexpert
Twitter: / naveenkhunteta
Blog: www.naveenautomationlabs.com
--------------------------------
Support My Channel✔️Or Buy Me A Coffee
Paypal: paypal.me/naveenkhunteta
Google Pay: naveenanimation20@gmail.com
--------------------------------
✔️Thanks for watching!
देखने के लिए धन्यवाद
Благодаря за гледането
感谢您观看
Merci d'avoir regardé
Grazie per la visione
Gracias por ver
شكرا للمشاهدة

Пікірлер: 103

  • @shivanidaftardar1164
    @shivanidaftardar11646 жыл бұрын

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

  • @Vinodmhetre007
    @Vinodmhetre0073 жыл бұрын

    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 KZread 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

  • @minkugrang9524
    @minkugrang95246 жыл бұрын

    Thanks Naveen.Thanks for sharing your information.

  • @sarangmech
    @sarangmech3 жыл бұрын

    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.

  • @omkarpotdar2763
    @omkarpotdar2763 Жыл бұрын

    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.

  • @KrishnaKumar-uq4lk
    @KrishnaKumar-uq4lk4 жыл бұрын

    Very Nice session. Very informative. Thanks Naveen

  • @ankitabiswal373
    @ankitabiswal3734 жыл бұрын

    THANK U So much naveen..

  • @pragtigupta5675
    @pragtigupta56754 жыл бұрын

    thanks for the video Naveen, very indetailed description!

  • @MrMadhur18
    @MrMadhur186 жыл бұрын

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

  • @A_philodendron
    @A_philodendron4 жыл бұрын

    Very well explained 👍

  • @nakulsingh8318
    @nakulsingh83184 жыл бұрын

    this is great vedio bro and good explained...

  • @v2factsandupdates327
    @v2factsandupdates3272 жыл бұрын

    Awesome tutorial sir ji

  • @ShubhamGupta-wq4ew
    @ShubhamGupta-wq4ew5 жыл бұрын

    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 ?

  • @albertlopez1705
    @albertlopez17054 жыл бұрын

    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.

  • @anweshkumarnayak2708
    @anweshkumarnayak27084 жыл бұрын

    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).

  • @nandiniarumugam9772
    @nandiniarumugam97726 жыл бұрын

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

  • @naveenautomationlabs

    @naveenautomationlabs

    6 жыл бұрын

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

  • @debashisnanda454
    @debashisnanda4545 жыл бұрын

    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?

  • @suhail4343
    @suhail43435 жыл бұрын

    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.

  • @vaishaliagrawal4781
    @vaishaliagrawal47815 жыл бұрын

    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

  • @ashishsingh4871

    @ashishsingh4871

    4 жыл бұрын

    It Will for java applications also

  • @shivaprasad1341
    @shivaprasad13414 жыл бұрын

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

  • @prabakarm5025
    @prabakarm50256 жыл бұрын

    nice

  • @ankitkumarmohapatra3548
    @ankitkumarmohapatra35484 жыл бұрын

    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 ?

  • @harshitaprasad2236
    @harshitaprasad22364 жыл бұрын

    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

    3 жыл бұрын

    I'm also facing same prblem

  • @alpijain4270
    @alpijain42703 жыл бұрын

    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.

  • @mohanrammanikandan7939
    @mohanrammanikandan79393 жыл бұрын

    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?

  • @raghuram7893
    @raghuram78932 жыл бұрын

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

  • @sunilreddymallela
    @sunilreddymallela6 жыл бұрын

    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

    6 жыл бұрын

    Hi Sunil, This types of logs will be generated by WebDriver FireEvents. Please refer my tutorial: kzread.info/dash/bejne/emZhldlmd7TAY8o.html

  • @SuperOm12
    @SuperOm124 жыл бұрын

    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

    4 жыл бұрын

    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

  • @anittatom9304
    @anittatom93042 жыл бұрын

    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.

  • @sumit121121
    @sumit1211213 жыл бұрын

    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

    2 жыл бұрын

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

  • @pavithrasathyanarayanan4618
    @pavithrasathyanarayanan4618 Жыл бұрын

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

  • @sutharsansadhasivam2401
    @sutharsansadhasivam24015 жыл бұрын

    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

  • @kranthikoura411
    @kranthikoura4114 жыл бұрын

    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 !

  • @yugandherakkunuru96
    @yugandherakkunuru965 жыл бұрын

    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

    5 жыл бұрын

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

  • @themusicblaze2692
    @themusicblaze26924 жыл бұрын

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

  • @prosperg186
    @prosperg1864 жыл бұрын

    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");

  • @salonabajracharya201
    @salonabajracharya2014 жыл бұрын

    how do i use same log file for different classes?

  • @Sifat1441
    @Sifat14416 жыл бұрын

    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.

  • @ManishKumar-no5qg

    @ManishKumar-no5qg

    5 жыл бұрын

    Even I am not able to see anything being logged on console. Even application.log file is empty.

  • @shilpijoshi5040

    @shilpijoshi5040

    5 жыл бұрын

    @@ManishKumar-no5qg Same for me also

  • @prasannasanikommu5133

    @prasannasanikommu5133

    5 жыл бұрын

    same for me also

  • @prasannasanikommu5133

    @prasannasanikommu5133

    5 жыл бұрын

    working with selenium 3.5.3

  • @shoyebkhatib8084

    @shoyebkhatib8084

    5 жыл бұрын

    Hi Emadul, any luck on this, I tried and am facing the same issue

  • @SRohithKumar1977
    @SRohithKumar19776 жыл бұрын

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

  • @thirumuruganganesan5234
    @thirumuruganganesan52345 жыл бұрын

    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

  • @madhurinaik5396
    @madhurinaik53963 жыл бұрын

    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.

  • @anamikad9042
    @anamikad90426 жыл бұрын

    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

    4 жыл бұрын

    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

    9 ай бұрын

    Did you refresh the project ?

  • @priyankagupta4589
    @priyankagupta45894 жыл бұрын

    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

  • @sutharsansadhasivam2401
    @sutharsansadhasivam24015 жыл бұрын

    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

  • @sathyasachin1696
    @sathyasachin16964 жыл бұрын

    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

    4 жыл бұрын

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

  • @mithaleepardeshi4893

    @mithaleepardeshi4893

    4 жыл бұрын

    @@yogsalunke7260 This really worked Thank you.

  • @utharsmart7702
    @utharsmart77024 жыл бұрын

    Bro pls change ur device text bigger for ur upcomming videos

  • @factsofallahal-shaheedserv7816
    @factsofallahal-shaheedserv78162 жыл бұрын

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

  • @rentyrajendran8468

    @rentyrajendran8468

    2 жыл бұрын

    Ctrl Shift O

  • @yogsalunke7260
    @yogsalunke72604 жыл бұрын

    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

    3 жыл бұрын

    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 ?

  • @rashmichethan
    @rashmichethan6 жыл бұрын

    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.

  • @neelureddy3655

    @neelureddy3655

    Жыл бұрын

    same issue

  • @shafeekahamed1767
    @shafeekahamed17672 жыл бұрын

    After upgraded the log4j no logs found in console

  • @chetanyadav708
    @chetanyadav7084 жыл бұрын

    gold !!!

  • @sb7355
    @sb73554 жыл бұрын

    Hi Sir, could you please provide this code.

  • @adnanfaisal1085
    @adnanfaisal10854 жыл бұрын

    Tried it exactly as shown. No logs came.

  • @jazibrahman2316

    @jazibrahman2316

    4 жыл бұрын

    Same here

  • @phaneendranv
    @phaneendranv5 жыл бұрын

    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.

  • @2mahender
    @2mahender5 жыл бұрын

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

  • @benitopaul4723
    @benitopaul4723 Жыл бұрын

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

  • @SuyashNande
    @SuyashNande6 жыл бұрын

    zoom your video, if you are teaching someone.

  • @naveenautomationlabs

    @naveenautomationlabs

    6 жыл бұрын

    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 жыл бұрын

    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 жыл бұрын

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

  • @bharathkoneru4008

    @bharathkoneru4008

    5 жыл бұрын

    @@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

    4 жыл бұрын

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

  • @ayushisrivastava4001
    @ayushisrivastava40012 жыл бұрын

    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 жыл бұрын

    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🤙🏻

Келесі