# How can I configure debug-level logging in my unit tests?

**URL:** <https://erlangforums.com/t/how-can-i-configure-debug-level-logging-in-my-unit-tests/2678>\
**Category:** Questions / Help\
**Tags:** rebar3, logger\
**Created:** [June 9, 2023, 5:32pm UTC](https://erlangforums.com/t/how-can-i-configure-debug-level-logging-in-my-unit-tests/2678 "2023-06-09T17:32:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlipscombe](https://erlangforums.com/user_avatar/erlangforums.com/rlipscombe/32/459_2.png) [@rlipscombe](https://erlangforums.com/u/rlipscombe)\
**Post date:** [June 9, 2023, 5:32pm UTC](https://erlangforums.com/t/how-can-i-configure-debug-level-logging-in-my-unit-tests/2678/1 "2023-06-09T17:32:08Z")

</div>

I’ve got some `?LOG_DEBUG` statements in my code. I’d like to see it while running `rebar3 eunit`. How can I configure debug-level logging in my unit tests?

---

<div class="post-metadata">

**Author:** ![rlipscombe](https://erlangforums.com/user_avatar/erlangforums.com/rlipscombe/32/459_2.png) [@rlipscombe](https://erlangforums.com/u/rlipscombe)\
**Post date:** [June 9, 2023, 5:55pm UTC](https://erlangforums.com/t/how-can-i-configure-debug-level-logging-in-my-unit-tests/2678/2 "2023-06-09T17:55:26Z")

</div>

Found it: [Base Config | Rebar3](https://rebar3.org/docs/configuration/configuration/#eunit); use the `--sys_config` option.

---

<div class="post-metadata">

**Author:** ![phild](https://erlangforums.com/user_avatar/erlangforums.com/phild/32/742_2.png) [@phild](https://erlangforums.com/u/phild)\
**Post date:** [June 12, 2023, 10:58am UTC](https://erlangforums.com/t/how-can-i-configure-debug-level-logging-in-my-unit-tests/2678/3 "2023-06-12T10:58:57Z")

</div>

Sample `sys.config` for others treading this path:

```erlang
[
    {kernel, [
        {logger_level, debug}
    ]}
].

```

Or, for a more concise output:

```erlang
[
    {kernel, [
        {logger_level, debug},
        {logger, [
            {handler, default, logger_std_h, #{
                formatter => {logger_formatter, #{
                    template => [level,": ",msg,"\n"]
                }}
            }}
        ]}
    ]}
].

```

See [Erlang – logger\_formatter](https://www.erlang.org/doc/man/logger_formatter.html) for more details.
