How to use production.log under command line ?

41 views
Skip to first unread message

Pavel Serikov

unread,
Mar 23, 2016, 7:09:37 AM3/23/16
to Mojolicious
I'm calling one of route of my Mojolicious::Lite app via cron, using command-line interface, like this:

*/5 * * * * perl /home/lab/MyApp get /update?filter=opened

inside MyApp there is some logging strings like

app->log->info('Variable a:'.$a);

But as I noticed that app is not writing to production.log or debug.log when accessed via command line.

How to call same (as access to routes via browser) logging when access the app via command line?

Jan Henning Thorsen

unread,
Mar 23, 2016, 10:07:20 AM3/23/16
to Mojolicious
Have you tried "perl /home/lab/MyApp get -m production /update?filter=opened" ?

For more information: mojo get --help

Jan Henning Thorsen

unread,
Mar 23, 2016, 10:10:59 AM3/23/16
to Mojolicious
Oh! I missed out on "debug.log" as well. Could it be wrong file permissions? There's a lot that can go wrong when running from "cron".

I normally add "1>/tmp/cron-app-tmp.log 2>&1" when I can't figure out what is going on.

Pavel Serikov

unread,
Mar 24, 2016, 2:12:20 PM3/24/16
to Mojolicious
Great, thank you for tip. It works perfectly :)

среда, 23 марта 2016 г., 17:10:59 UTC+3 пользователь Jan Henning Thorsen написал:
Reply all
Reply to author
Forward
0 new messages