# How to set the visible-log-level from the test suite/code?

**URL:** <https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755>\
**Category:** Robot Framework\
**Created:** [9 April 2025 10:35 UTC](https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755 "2025-04-09T10:35:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![terhi](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@terhi](https://forum.robotframework.org/u/terhi)\
**Post date:** [9 April 2025 10:35 UTC](https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755/1 "2025-04-09T10:35:37Z")

</div>

Hi,

I can set visible log level when giving command: robot -L TRACE:INFO from terminal and it is working ok ([Robot Framework User Guide](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#visible-log-level) ). But I’d like to set the visible-log-level from the test suite/code, but haven’t found t a way to do that. Is there some way to do that because ‘Set Log Level’ doesn’t take \<log\_level\>:\<visible\_log\_level\> as value.  
Why this is not possible with Set Log Level? Possible values there are only TRACE, DEBUG, INFO, WARN, ERROR and NONE ([http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Set%20Log%20Level](http://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Set%20Log%20Level))

Br,  
Terhi

---

<div class="post-metadata">

**Author:** ![rasjani](https://avatars.discourse-cdn.com/v4/letter/r/858c86/32.png) [@rasjani](https://forum.robotframework.org/u/rasjani)\
**Post date:** [9 April 2025 11:47 UTC](https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755/2 "2025-04-09T11:47:25Z")

</div>

I would assume that setting the log level at runtime would be “too late” because something before setting the log level has already had a possible output to console ?

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [11 April 2025 12:18 UTC](https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755/3 "2025-04-11T12:18:35Z")

</div>

Hi Terhi,

I was curious why you’d set 2 log levels on the command line, what’s the difference, after reading the documentation you linked, and a few others sections of the user guide, I think I understand.

When you use ` robot -L TRACE:INFO` the log level is at Trace while running, but when the test finishes the log level for the log.html is set to default to Info.

So I’m wondering if you can achieve the same by calling `Set Log Level TRACE` in your Setup, or wherever you need to call it, and then call `Set Log Level INFO` in your Teardown?

Hope this helps,

Dave.

---

<div class="post-metadata">

**Author:** ![terhi](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@terhi](https://forum.robotframework.org/u/terhi)\
**Post date:** [14 April 2025 08:07 UTC](https://forum.robotframework.org/t/how-to-set-the-visible-log-level-from-the-test-suite-code/8755/4 "2025-04-14T08:07:33Z")

</div>

> [@damies13](#):
>
> Set Log Level INFO

This didn’t work. Log.html opens as TRACE even though Set Log Level INFO was given in suite teardown.
