Search code examples
erlangchicagoboss

Chicagoboss - How to update lager_file_backend config?


I have updated ChicagoBoss to my latest version. When I'm compiling it, I'm getting a notice as

Deprecated lager_file_backend config detected, please consider updating it

I'm compiling it using following command:

 ./rebar get-deps clean compile

So, the questions are:

  • What is lager_file_backend config?
  • Why it is deprecated?
  • How to update it.?

Solution

    • lager_file_backend config simply refers to the 'lager_file_backend' section of your configuration file (boss.config)

    • I don't know why it is being deprecated, sorry.

    • I had trouble finding release notes detailing the differences. I figured out how to update by looking at the example here: https://github.com/basho/lager

    Here's what the old style looks like:

    {lager, [
        {handlers, [
          {lager_console_backend, info},
          {lager_file_backend, [
            {"/var/log/foo/boss_error.log", error, 10485760, "$D0", 5},
           {"/var/log/foo/boss_console.log", info, 10485760, "$D0", 5}
          ]}
        ]}
      ]},
    

    Here's what the new style looks like:

    {lager, [
        {handlers, [
          {lager_console_backend, info},
          {lager_file_backend, [{file, "/var/log/foo/boss_error.log"},  {level, error}]},
          {lager_file_backend, [{file, "/var/log/foo/boss_console.log"}, {level, info}]}
        ]}
    ]},