Dancer2 failing to read the configuration file quietly

88 Views Asked by At

This is more or less the same problem I had here with the log file, with a bit of more information and a different configuration

With this configuration file (in the root directory):

port: 31415
content_type: "application/json"
engines:
  logger:
    File:
      log_level: core
      file_name: "p5hitos.log"
logger: "File"

and this main program (hitos.psgi, same directory):

use v5.14;
use lib qw(lib);

use My::Hitos;
use Dancer2 appname => 'My::Hitos';

dance;

Routes are included into another file, I'm not sure it's really necessary here, but all code is here)

the program fails to read the configuration. Funny thing is, if I put the last line first, it fails to log in any way. Putting "logger" as the last line in the file it logs to the console, not to the place I configured. It's also failing to set the port, or the default content_type. The manual seems to imply there's some setting that says the configuration file we'll be using. Not totally clear what that setting would be, or how to set it, or what's actually the default configuration file extension. Any idea?

Update: I have copied config.yml to lib/My... and well, it looks like it's reading it, because runner actually has those features in the configuration, and it does says a message. It's also logging... something, and to console:

We are logging Entering hook core.error.afterWe are logging
We are logging looking for get /statusWe are logging
We are logging Entering hook core.app.before_requestWe are logging

(after setting the export DANCER_CONFIG_VERBOSE=1). Still not doing it to the configured place.

0

There are 0 best solutions below