Framework: Debugging Artisan Custom Command

Created on 12 Nov 2013  路  4Comments  路  Source: laravel/framework

I've asked in the Forums, now I am trying to get the information here...

I had a properly published custom Artisan command. It was working fine. Then I have introduced some changes, and now there is a bug - an error message appears, pretty styled with red background and white font color, and the error itself is simple.

But the error message does not sat at which file / line the error happened.

I've looked at the logs at app/storage/logs - the error does not show up there.

I've looked PHP's error log (the CLI log, but even the FPM log also!) - the error also does not appear there.

What should I do to get more information about the error - in the context of an Artisan custom command?

Thank you.

Most helpful comment

I'm looking for a way to debug a Command....

So I can run it and stop it with a breakpoint and debug it...

All 4 comments

The error will be in your logs. Did you check in the CLI log of your app/storage/logs folder, not the web log?

Perfect! I have not noticed that there are two distinct logs at app/storage/logs. Sorry. The error, with the full stack trace, is there. Thanks!

I'm looking for a way to debug a Command....

So I can run it and stop it with a breakpoint and debug it...

I request that this issue be reopened now that we live in a Docker world.

WHEN you hit the "no stack trace in the console output" problem
WHILE docker-execing a command on a container in which log directories are not extremely carefully configured (one of a dozen ways it can go wrong: you execute some commands on the host and some others on the container, and the log file gets created on the host and has wrong ownership on the container)
THEN you must jump through incredible hoops in order to get your hands at the log.

Please JUST ADD A WAY to get the stack trace in the console output, plainly and simply, without jumping through hoops.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kerbylav picture kerbylav  路  3Comments

PhiloNL picture PhiloNL  路  3Comments

RomainSauvaire picture RomainSauvaire  路  3Comments

lzp819739483 picture lzp819739483  路  3Comments

jackmu95 picture jackmu95  路  3Comments