Closed smockensturm closed 8 years ago
Can you try the develop
branch?
Yes. Same. No log.
Well yeah, you don't get logs if devMode is off. Logs are only saved in devMode true. This is expected behavior.
That is simply not true!
Check this answer:
And this article, including the following statement:
If you want a log item to appear regardless of whether devMode is enabled, you can pass true as the third argument to the log() method.
Ah ok, so you're forcing the log entry?
Edit: duh, my bad
Well yeah, Craft tasks can show weird behavior when your output buffer is messed up. This can be the result of faulty gzip compression.
Can you try my TaskManager plugin and run the command craft/app/etc/yiic taskmanager run
whilst setting runTasksAutomatically
to false
in craft/config/general.php
. This way the task gets run in the command line and not via http.
fwiw, I always run tasks in a separate worker node to relieve the web node.
I'd rather not.
That's just dandy for an ace developer such as yourself, but we have clients breathing down our necks, and we can't afford all this extra time. Thanks for your help.
I meant just run it once and see if it works. If it does there is something going on with http. If it doesn't there is something else interfering.
I have no idea what this task manager is supposed to do or how it works. There is no yiic directory in craft/app/etc
Sorry, its in craft/app/etc/console
. yiic
is an executable program. The task manager will run the task in the command line instead of via http/controller.
OK. So it appears to have run successfully. What am I looking for? Still no logs for our Import Helper.
Well, if the logging worked then you would see that in the command line. Can you confirm any other logging (like in getName) is showing up in the command line?
Nope. No logs in the console. No logs in runtime.
That's weird. In the log function there is this line, which should always be executed in your case:
if (craft()->isConsole())
{
echo $msg."\n";
}
Can you post the complete output of the yiic command?
Sure. output.txt
Okay, as you can see its failing because it can't connect to the db in the command line. Please add a working config in '*' in db.php.
There is this.
'*' => array(
'tablePrefix' => 'craft',
),
And this.
'aoa.dev' => array(
'server' => 'localhost',
'user' => 'root',
'password' => 'root',
'database' => 'craft_aoa'
),
Move that over to '*"
I did. Same output.txt .
Try 127.0.0.1 instead of localhost
Same. output.txt
Look, man. This is some pretty low-level nonsense for users just trying to build a CMS. We're going to ditch the SmartMap plug-in so we can run your import in devMode, then the logs will output as expected, and I'm going to let you run down why your hook won't honor forced logging.
Edit: have you even tried it?
Ok. I'm just trying to find out where the issue is, as I'm pretty sure its not in that hook ;-). But if you're good to go, i'll just close this.
"Pretty sure?" I think you should try it yourself before you dismiss this. Try forced logging in an Import Helper plug-in that uses the hook and see if it's just me. Report back. It would irresponsible for you not to try and just assume you're "pretty sure" it's not something in your code.
If it's just me, then it's on me and my problem. If it's broke, you should fix it.
Shouldn't take but a fraction of the time it's taken me to help you run this down. Only fair.
Well? Did you at least try it? Shouldn't take you more than a few minutes.
Continued in #138
Dev mode is false. We are trying to force some logs so we can monitor the data and develop an import helper. Tried nothing in the hook but this, and there is nothing output in the logs.
Now, if we put that into the getName method, we get all kinds of logging output.
Yields several of these:
2016/09/14 09:56:02 [info] [plugin] [Forced] What is up, yo?
What are we doing wrong? What else should we be looking for?