-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging in Serenity HTML Dashboard reports. #213
Comments
Serenity uses SLF4J, so this would be the most natural approach. |
Beauty of Serenity is almost all of the things are ready to use, no configuration require at all. I didnt make any configuration so far. How about logging? Is it available OOTB or I need to set it up? Which API , function I would use? Any doc to refer? |
Serenity uses SLF4J (https://www.slf4j.org). Any messages logged using an SLF4J logger will appear in the console, as long as you have a correct SLF4J implementation on your path, e.g.
Then you can use an SLF4J logger like this:
The starter projects have a configured logbook-test.xml (see https://github.com/serenity-bdd/serenity-cucumber-starter for am example). |
Hey @wakaleo I have tried to implement it and it prints logs in the console but doesn't generate a .log file. I guess it is because of below error
This is
This is
Added below dependency in
|
Hi @wakaleo , |
What makes you think logging happens after execution is completed? Serenity logs to the console in real time - the rest is up to the slf4j/maven/gradle config |
Thank you @wakaleo .. |
@when("I search with {string} in the home page") |
I implement all the steps you told but it does not accept the term variable inside the log brackets and gives an error. What could be the reason? |
What error are you getting? What makes you think this is related to Serenity? |
If you are getting an error from the logger, you will need to check the documentation or raise an issue with the logging library you are using. |
How can i put the logging into a file.. to not see things which are logged by other processes when the program is run. but just those statements which i have printed using log.info |
Looking for logging mechanism.
One for debugging purpose and and for info purpose. So that I can switch on/off when I want to see info logs and when I want to see debug logs.
log.info("");
log.debug("");
when debugging mode is on, both will appear and when info mode is on only info logs would appear.
Is this present Out Of the Box in serenity?
The text was updated successfully, but these errors were encountered: