New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong documentation abt Logging in Piwik 3.x #12307
Comments
It won't be removed any time soon and feel free to use it. Won't even b removed in Matomo 4.0. In case you want to log eg in a dimension, this should work best without needing to use StaticContainer: public function __construct(\Psr\Log\LoggerInterface $log)
{
$this->log = $log;
} There is no doc to be updated as StaticContainer is still deprecated and avoided to be used. Although the message "that it will be removed in 3.0" could be actually removed :) |
Okay, thanks. As far as I understand is that |
yep |
For me is enough to know and I think if someone will find help about it will find this post.
Maybe should be updated «in 4.x release will be removed» ? Thank you all for supporting ^ç^ |
I would propose removing "that it will be removed in 3.0" and instead link to this issue as it makes everything clear. |
Ciao!
I'm updating an old plugin born while Piwik was 1.x. It flawless worked inside Piwik 2.x but now must be updated.
I've started from scratch generating plugin's parts using console generator. Now I have a custom Dimension, I'm on its development and I'm trying to log things inside plugins/ThePlugin/Columns/ColumnName.php
onNewVisit
method.Piwik 3.x Logging documentation suggests to log using
StaticContainer::getContainer()->get('Psr\Log\LoggerInterface')
(as 2.X docs said before) but inside PHPStorm that stuff pops up as deprecated.While I was reading StaticContainer source code I found a note: in 3.X release will be removed.
Any help and suggestion how to get rid of StaticContainer and using real DI is appreciated 😸
Best regards, thank you
The text was updated successfully, but these errors were encountered: