no more logs using logger with common tests

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

no more logs using logger with common tests

Benoit Chesneau-2
Hi all,

I've switched my code to logger macros instead of using lager. But now I've no log stored on the filesystem ie in `_build/test/logs/ct_run.nonode\@nohost.2019-05-28_10.49.10/` or similar folder.. Any idea what could be the issue?


 
I use  following sys config:

```
[
 {kernel,
  [
   {logger_level, debug},


   {logger,
    [{handler, default, logger_std_h,
      #{level => error,
        config => #{file => "log/erlang.log"}}},

     {handler, info, logger_std_h,
      #{level => debug,
        config => #{file => "log/debug.log"}}}
    ]}]}
].
```

ad my rebar.config:

```
...
{ct_opts, [
  {sys_config, ["config/test.config"]},

  {ct_hooks, [cth_surefire]}

]}.
```

Hope it helps, any idea is welcome :)

Benoit


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: no more logs using logger with common tests

Siri Hansen
Do you see any printout in the shell like 

Logger - error: {removed_failing_handler,default}

??

The log files should be created relative to your current work directory - but when trying similar configuration as you describe it seems logger fails pretty soon due to ct's change of current directory :( Can you try it once with an absolute path to verify if you're facing the same problem or if it's something else?

Regards
/siri

tir. 28. mai 2019 kl. 11:14 skrev Benoit Chesneau <[hidden email]>:
Hi all,

I've switched my code to logger macros instead of using lager. But now I've no log stored on the filesystem ie in `_build/test/logs/ct_run.nonode\@nohost.2019-05-28_10.49.10/` or similar folder.. Any idea what could be the issue?


 
I use  following sys config:

```
[
 {kernel,
  [
   {logger_level, debug},


   {logger,
    [{handler, default, logger_std_h,
      #{level => error,
        config => #{file => "log/erlang.log"}}},

     {handler, info, logger_std_h,
      #{level => debug,
        config => #{file => "log/debug.log"}}}
    ]}]}
].
```

ad my rebar.config:

```
...
{ct_opts, [
  {sys_config, ["config/test.config"]},

  {ct_hooks, [cth_surefire]}

]}.
```

Hope it helps, any idea is welcome :)

Benoit

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: no more logs using logger with common tests

Siri Hansen
This PR should solve the problem with relative paths: https://github.com/erlang/otp/pull/2264

tir. 28. mai 2019 kl. 12:35 skrev Siri Hansen <[hidden email]>:
Do you see any printout in the shell like 

Logger - error: {removed_failing_handler,default}

??

The log files should be created relative to your current work directory - but when trying similar configuration as you describe it seems logger fails pretty soon due to ct's change of current directory :( Can you try it once with an absolute path to verify if you're facing the same problem or if it's something else?

Regards
/siri

tir. 28. mai 2019 kl. 11:14 skrev Benoit Chesneau <[hidden email]>:
Hi all,

I've switched my code to logger macros instead of using lager. But now I've no log stored on the filesystem ie in `_build/test/logs/ct_run.nonode\@nohost.2019-05-28_10.49.10/` or similar folder.. Any idea what could be the issue?


 
I use  following sys config:

```
[
 {kernel,
  [
   {logger_level, debug},


   {logger,
    [{handler, default, logger_std_h,
      #{level => error,
        config => #{file => "log/erlang.log"}}},

     {handler, info, logger_std_h,
      #{level => debug,
        config => #{file => "log/debug.log"}}}
    ]}]}
].
```

ad my rebar.config:

```
...
{ct_opts, [
  {sys_config, ["config/test.config"]},

  {ct_hooks, [cth_surefire]}

]}.
```

Hope it helps, any idea is welcome :)

Benoit

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions