@mstenz opened this Issue on January 6th 2021

they are just shown on the console, there is no entry for hard error message in php_error.log (everything is silent) but also the logmessages manually shown are not recorded anywhere even debug logging is enabled in general.
Maybe it is worth to allow a seperate log file for the console. This includes especially the Tasks Scheduler Outputs and all other messages on the console.
The only messages i see in the debug log are when some archiving is done, but only the detailed sql queries, not the other messages what is now happening.

@tsteur commented on January 10th 2021 Member

It seems to indeed not log to the matomo.log even when file logging is enabled. I can only assume this is on purpose currently. Haven't found yet where this is done though. Do you maybe know @diosmosis ?

Generally, we recommend people for cronjobs to pipe the output to a file like

./console ... > /path/to/cronjobs.log

Does this maybe help?

@mstenz commented on January 10th 2021

Thx, i am using Windows. Logging like this in cron is not possible when using the Task Scheduler directly with arguments fields (as it is default).
The Problem with redirecting to file is that it does not use the different logging mechnics that Matomo have and also Debug Messages are not part of a normal console output.

@diosmosis commented on January 10th 2021 Member

@tsteur it's in Monolog/config/cli.php, the log.handlers key is overridden to only output to console.

@tsteur commented on January 11th 2021 Member

Thanks @diosmosis

@mattab @diosmosis @sgiehl does maybe anyone remember why that was done? I reckon if file logger is enabled, it be great to additionally also log to file. But maybe there's a reason for it... or it just was never implemented or forgotten.

@diosmosis commented on January 11th 2021 Member

Seems like it was on purpose, but I'm not sure why. Maybe there was the assumption CLI commands would be redirected if the output was to be saved. It would be easy to fix I think, just use a \DI\decorate.

@sgiehl commented on January 11th 2021 Member

Don't know a reason either. Guess would be fine to log them to file as well

@tsteur commented on January 11th 2021 Member

👍 I'll put it into 4.4 as it would be useful potentially on cloud too. When a file logger is configured, it should also log to file.

Powered by GitHub Issue Mirror