Re: How to used log4j file in my Selenium webdriver

264 views
Skip to first unread message
Message has been deleted

Kavan Sheth

unread,
Dec 22, 2014, 1:45:04 PM12/22/14
to seleniu...@googlegroups.com

There is no need to call you logger only from main, it is key based so you can call it from anywhere,

- Add log4j2 jar to your build path
- Create log4j2.xml file in your src path(else need to specify -Dlog4j2.configuration=file:///path)
- start using logger in your code by accessing using a unique key like
      private static Logger logger= LogManager.getLogger("myLogger"); 
  with following commands 
    logger.info() , logger.error(), logger.debug, logger.entry()  etc...

for brief information:

Thanks,
Kavan

On Monday, December 22, 2014 2:20:08 PM UTC+5:30, Amoll Badgujar wrote:
will u please tell me how to add log4j file code in my selenium webdriver using java.

 Structure is ..
auto
  -src
    - com.next.main
    - com.next.task

i just wanted to add log4j file code in main method through main method i had call all my classes.
so thats why i just add in main().
Message has been deleted
Message has been deleted

pushpinder rattan

unread,
Dec 24, 2014, 10:00:18 AM12/24/14
to seleniu...@googlegroups.com
just keep log4j.properties in the src folder.

On Mon, Dec 22, 2014 at 2:20 PM, Amoll Badgujar <amollb...@gmail.com> wrote:
will u please tell me how to add log4j file code in my selenium webdriver using java.

 Structure is ..
auto
  -src
    - com.next.main
    - com.next.task

i just wanted to add log4j file code in main method through main method i had call all my classes.
so thats why i just add in main().

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/1eb2b9dc-7321-4f11-a57c-8c730027fb32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
0 new messages