PerlDancer / Dancer2

Perl Dancer Next Generation (rewrite of Perl Dancer)
http://perldancer.org/
Other
543 stars 273 forks source link

Issues with configuration #1584

Open JJ opened 3 years ago

JJ commented 3 years ago

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

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.

1nickt commented 3 years ago

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

JJ commented 3 years ago

Thanks for the answer. Where is it, then?

1nickt commented 3 years ago

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?)