Re: [testng-users] log4j and Reporter.log

418 views
Skip to first unread message

Krishnan Mahadevan

unread,
Jun 10, 2013, 10:39:36 PM6/10/13
to testng...@googlegroups.com
I believe Reporter.log() uses System.out.println() to print data to the console and internally relies on TestNG data structures to persist test specific logs so that it can be accessed by the reporters. 

Am not sure if what you are trying to do can be achieved or not. 

On Monday, June 10, 2013, Peeshoo wrote:
Hello,

I am using testNG & hudson to run and store test reports.  I can view all my test results online and am using Reporter.log to log detailed info into the test run.

What is the best way to pass the output of log4j logger statements to the Reporter.log method?


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

Peeshoo

unread,
Jun 11, 2013, 12:38:06 AM6/11/13
to testng...@googlegroups.com
One idea I had, was that If I could get the output of log4j into a String, I could then pass it to Reporter.log. 

The only way I can see to do this would be to have my log4j log to a different buffer using an appendeer, and then flush this buffer into a string to send to Reporter.log.  However, doing all these IO operations every time I log sound slow and also possibly complicated with parallel test runs.

Thats why I wanted to know if there is another way to do this...


On Monday, June 10, 2013 7:39:36 PM UTC-7, Krishnan wrote:
I believe Reporter.log() uses System.out.println() to print data to the console and internally relies on TestNG data structures to persist test specific logs so that it can be accessed by the reporters. 

Am not sure if what you are trying to do can be achieved or not. 

On Monday, June 10, 2013, Peeshoo wrote:
Hello,

I am using testNG & hudson to run and store test reports.  I can view all my test results online and am using Reporter.log to log detailed info into the test run.

What is the best way to pass the output of log4j logger statements to the Reporter.log method?


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
Visit this group at http://groups.google.com/group/testng-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages