[Dancer-users] How to debug Dancer?

Naveed Massjouni naveedm9 at gmail.com
Sun Sep 26 06:54:43 CEST 2010


On Sat, Sep 25, 2010 at 10:17 PM, woosley. xu. <redicaps at gmail.com> wrote:
> Hi all,
>        I just begin to use Dancer to build some small sites. It is
> convenient for sure. But, my problem is, how can I debug a site when I met
> problems?
>        I start with the code just  a PL file, no packages, all the request
> and function in one file. If there is any Perl grammar errors,  sure Perl
> can find them for me, but if there is any other run time errors, dancer just
> give me a Error 500, and there is nothing in the log file.
>        Here is the log configuration in my code, I tried to use debug "Hey,
> I got here!", however,  this line never shows up in the log file, maybe it
> never execute? I have no idea.
>
>             set logger   => 'file';
>             set log      => 'core';
>       the common thing I have in the log is
>
>             [10141]  core @0.020718> [hit #1] response: 500 in
> /opt/csw/share/perl/site_perl/Dancer/Handler.pm l. 102
>
>        How can I get all the error information?
> Thanks
> --
> Woosley.Xu

So I created a simple dancer application in a single file:

    use Dancer;
    set logger => 'file';
    set log => 'core';
    get '/' => sub {
        debug 'allo';
        return 'bye';
    };
    dance;

Then I ran:

    curl localhost:3000

When I viewed logs/development.log, I saw the expected debug message.

Maybe it would help if you provided some code that can reproduces the
problem you are experiencing.  And tell us exactly which version of
Dancer you are running.

Thanks,
Naveed


More information about the Dancer-users mailing list