Logs

#1
Hello!

Is there any way to have magento.cron.log contain anything else than LiteMage tag purges?

LiteMage purged tags cat_p_4784
LiteMage purged tags cat_p_4680
LiteMage purged tags cat_p_4681
LiteMage purged tags cat_p_4682
LiteMage purged tags cat_p_4683
 
#3
The file should contain error messages from the cron runs.

I may be wrong, but to me it seemed more likely that the people behind LiteMage would know why the file contains what I assume is output from their module?
 

Pong

Administrator
Staff member
#4
The file should contain error messages from the cron runs.
You will need to check Magento/system cron job to see why they did not output the correct info to the log you defined. It is not LiteMage related and litemage won't block your log output.
 

Pong

Administrator
Staff member
#6
"LiteMage purged tags cat_p_4784" like log lines should be generated by LiteMage. but your question seems to be "why Magento cron logging doesn't work?", is it(if so, Magento cron logging doesn't control by LiteMage)? or you want to see more logs from LiteMage? If not for both, can you clarify your question and your situation a little more?

Is there any way to have magento.cron.log contain anything else than LiteMage tag purges?
What is the "anything else" you really want to see?
 
#7
I'll try to rephrase:

From my understanding, magento.cron.log is supposed to contain errors from the cron runs and errors only - in other words, no output from successful runs. The output from the LiteMage appears to be a regular output message and should therefore not end up in the error log.

My questions are:

1) Since it still ends up there, is the module logging what it interprets as an error, or is it just a regular output message.
2) If the module logging an error, how can we see what the error is when it's logging a regular output message instead of the error.
3) If it's not an error, is it "overwriting" errors from other modules by forcing regular output to the error log?
 

Pong

Administrator
Staff member
#8
magento.cron.log is supposed to contain errors from the cron runs and errors only - in other words, no output from successful runs.
no, it should be an cron action log, not error log. It should record all cron actions no matter successfully run, or failed.
 
#9
As described on the page you linked to earlier, the cron job is:

* * * * * /usr/bin/php /var/www/html/magento2/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/html/magento2/var/log/magento.cron.log

As I'm sure you know, the -v means invert match, so any other output than "Ran jobs by schedule" will be logged. From what I understand, this is so that the log file will contain error messages from modules if something went wrong. What is the point of filling up the log with successful runs? If there were no errors, the run was successful - there's no need to output this.

But please reply to my questions above if you can.
 

Pong

Administrator
Staff member
#10
If I understand you correctly, you want LiteMage to output less only when errors, right? Please log a ticket with us with tmp root ssh login and your magento admin login. We will check your settings. If it is something our LiteMage can be improved, we will forward to our developers.
 
#11
Hello! If you can confirm that this is the only line that needs to be removed from module-litemage/Controller/Shell/Purge.php to fix the issue, we can do it ourselves:

$this->getResponse()->setBody(sprintf("LiteMage purged tags %s \n", implode(',', $this->_tags)));

But wouldn't be a bad thing if you would consider addressing as well it in future updates.
 

Pong

Administrator
Staff member
#14
we have forwarded to our developer and she will review it later. maybe provide silent & verbose mode as an option to the user.
 
Top