Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Issues with configuration

Open JJ opened this issue 4 years ago • 3 comments

As indicated in #1583, there's some ambiguity on where the config.yml file would go. But additionally, there're a few issues:

  • Some settings simply do not seem to work. port is simply ignored, for instance. Apparently, content_type too.
  • There seems to be some dependence on where the logger directive is placed, which, a YAML file being declarative, probably should not.
  • When using a configuration file, additional settings seem to be ignored.
port: 31415
content_type: "application/json"
engines:
  logger:
    File:
      log_level: core
      file_name: "hitos.log"
logger: "File"

followed by set log_dir => '/tmp' is simply ignored.

JJ avatar Feb 04 '21 08:02 JJ

set log_dir => '/tmp' sets a top-level config key, but that's not where the one you want to override is.

1nickt avatar Mar 07 '21 00:03 1nickt

Thanks for the answer. Where is it, then?

JJ avatar Mar 07 '21 08:03 JJ

Hi JJ

set sets top-level configuration values. I don;t know if it can be used to set subvalues.

But config returns a hashref which you can change.

config->{engines}{logger}{File}{file_name} = 'new.log';

I do not recommend this approach, but rather using the config files properly. Let's see if we can get you straightened out in your other issue ? (And maybe we can consolidate to one open issue?)

1nickt avatar Mar 07 '21 14:03 1nickt