Re: [jbehave-dev] Loggin in jbehave
Following up on Mauro's response... We extended the *StoryReporter* class and added log messages in certain methods we wanted logged such as: *failed(String step, Throwable cause)* *successful(String step)* *beforeScenario(String scenarioTitle)* *etc...* Then we added this new class to our StoryReportBuilder: * new StoryReporterBuilder().withReporters(new CustomStoryReporter())etc* Not sure if this is the best approach but it works for us. Regards, Christopher Aguirre On Thu, Jan 29, 2015 at 5:16 PM, Mauro Talevi mauro.tal...@aquilonia.org wrote: The reporters do not by default include any logger output, except for logger configured to wrote to sysout and then only for the Console output. If you want to do some quick debugging this is the easiest way. Else, you can define your own custom logging-based reporter that includes any log statements you want. Bear in mind that JBehave was designed to be log-agnostic. Cheers On 29/01/2015 08:56, Omer Shem-Tov wrote: Hi, I'm trying to add logging to jbehave, and I'm not sure what is the best practice. beside this discussion http://www.mail-archive.com/dev%40jbehave.codehaus.org/msg08872.html I didn't find any documentation. I'm trying to add log4j properties from a file, so when I log messages using logger.debug(message) and above it will go to text file, and messages like logger.info(message) and above will go to the console log. if I want also these messages to be shown in the html report? How can I do that? Why do I need to explicitly specify log4j as dependency in the pom? Thanks, Omer
Re: [jbehave-dev] Loggin in jbehave
We addressed this need by introducing the LoggingStoryReporter as shown early on in the thread. This allowed us to continue capturing system outs to the console (yuck) but also capture all our logging in a separate file. We sent up 2 log4j appenders to do this. On Thu, Jan 29, 2015 at 1:56 AM, Omer Shem-Tov omer...@gmail.com wrote: Hi, I'm trying to add logging to jbehave, and I'm not sure what is the best practice. beside this discussion http://www.mail-archive.com/dev%40jbehave.codehaus.org/msg08872.html I didn't find any documentation. I'm trying to add log4j properties from a file, so when I log messages using logger.debug(message) and above it will go to text file, and messages like logger.info(message) and above will go to the console log. if I want also these messages to be shown in the html report? How can I do that? Why do I need to explicitly specify log4j as dependency in the pom? Thanks, Omer -- Frank M. Pedroza --- Do not pray for easy lives. Pray to be stronger men. Do not pray for tasks equal to your powers. Pray for powers equal to your tasks. -- John F. Kennedy
[jbehave-dev] Loggin in jbehave
Hi, I'm trying to add logging to jbehave, and I'm not sure what is the best practice. beside this discussion http://www.mail-archive.com/dev%40jbehave.codehaus.org/msg08872.html I didn't find any documentation. I'm trying to add log4j properties from a file, so when I log messages using logger.debug(message) and above it will go to text file, and messages like logger.info(message) and above will go to the console log. if I want also these messages to be shown in the html report? How can I do that? Why do I need to explicitly specify log4j as dependency in the pom? Thanks, Omer
Re: [jbehave-dev] Loggin in jbehave
The reporters do not by default include any logger output, except for logger configured to wrote to sysout and then only for the Console output. If you want to do some quick debugging this is the easiest way. Else, you can define your own custom logging-based reporter that includes any log statements you want. Bear in mind that JBehave was designed to be log-agnostic. Cheers On 29/01/2015 08:56, Omer Shem-Tov wrote: Hi, I'm trying to add logging to jbehave, and I'm not sure what is the best practice. beside this discussion http://www.mail-archive.com/dev%40jbehave.codehaus.org/msg08872.html I didn't find any documentation. I'm trying to add log4j properties from a file, so when I log messages using logger.debug(message) and above it will go to text file, and messages like logger.info http://logger.info(message) and above will go to the console log. if I want also these messages to be shown in the html report? How can I do that? Why do I need to explicitly specify log4j as dependency in the pom? Thanks, Omer