9

Does Hypnotoad write any Logfile? I can't find anything about that here: http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad Also the option --help says nothing about it.

I understand, that application-wise I need to use stuff like $self->app->log->error('aua!')... but something like a server log does not exist? (e.g. client requests, internal errors, etc)

If the answer is just no, I'm fine. This would then mean, that I would need to implement this in my application I guess. I can imagine that it makes sense to keep server-code small and clean here, maybe this would be the reason for a lack of this functionality? Or is it that I can enable it?

Boris Däppen
  • 1,186
  • 7
  • 20

3 Answers3

12

If your application has a log folder, the log will be written there: http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Mode

Joel Berger
  • 20,180
  • 5
  • 49
  • 104
  • 2
    The linked page (http://mojolicio.us/perldoc/Mojolicious/Lite#Mode) doesn't confirm this fact, and I couldn't easily find any documentation of it, but in Mojolicious 6.03 it still works. Also, the `log` directory belongs in the same directory as the main script, at least by default (I'm not sure if there is a way to change this). – doshea Apr 22 '15 at 11:19
  • 1
    Good catch. Yes the `Mojolicious::Lite` documentation also used to double as the tutorial. Since then we have split the documentation so that there is an actual tutorial guide. I have updated the link. – Joel Berger Apr 23 '15 at 15:55
8

I don't think so, but it's easy to set one up.

use Mojo::Log;
...
app->log( Mojo::Log->new( path => <filename>, level => 'debug' ) );
...
app->start;
mob
  • 117,087
  • 18
  • 149
  • 283
3

app->log( Mojo::Log->new( path => , level => 'debug' ) );

Insert it to startup function

thekostya
  • 91
  • 1
  • 2