Skip to content
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

DeviceDetectorCache does not work with logs to stdout #16

Open
mikkeschiren opened this issue Jul 13, 2021 · 3 comments
Open

DeviceDetectorCache does not work with logs to stdout #16

mikkeschiren opened this issue Jul 13, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@mikkeschiren
Copy link

I realize that maybe this a no-fix - but today many setups of Matomo is running in Kubernetes or Docker, and logs in many setups goes to stdout, is there any simple way to use this plugin in that context?

@diosmosis
Copy link
Member

@mikkeschiren is this is a general matomo question or specific to DeviceDetectorCache? I don't see any output logging (apart from cli command output) in this plugin.

If for all of matomo, then it's possible to add logging to stdout via dependency injection. Adding something like this to /path/to/matom/config/config.php could work:

<?php

return [
    'log.handlers' => \DI\decorate(function ($previous) {
        $previous[] = new \Monolog\Handler\StreamHandler('php://stdout', Logger::WARNING);
        return $previous;
    }),
];

@mikkeschiren
Copy link
Author

As I understand this plugin, it is using logs to warm the cache, and because of logs going to stdout in a normal docker setup, it is not usable, I think, in a docker environment.

@tsteur tsteur added the enhancement New feature or request label Jul 21, 2021
@tsteur
Copy link
Member

tsteur commented Jul 21, 2021

The plugin indeed only works on log files. The docker would somehow need to be configured to write log files for every tracking request and Matomo needs to be able to have read access. It won't work otherwise unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants