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

Can I transform final Monolog request to curl string and log it somewhere? #1809

Open
zeyser opened this issue Jun 1, 2023 · 2 comments
Open
Labels

Comments

@zeyser
Copy link

zeyser commented Jun 1, 2023

Monolog 2

Hi. I'm trying to understand - Why I can't receive request from Monolog on my server(everything fine from local machine).
Because of that I want to transform Monolog request into cUrl string and execute it directly from server machine (I think that such request can be blocked on server side by firewall or something like that)

For initialisation I'm using next code

protected function init()
    {
        parent::init();

        $config = Factory::getInstance()->getConfigurationForInstallation('monolog');
        $host = $config->getHost();
        $port = $config->getPort();

        $handler = new SyslogUdpHandler($host, $port);
        $formatter = new LogstashFormatter('portal-log');
        $handler->setFormatter($formatter);

        $this->log = new Logger('portal-logger');
        $this->log->pushHandler($handler);
    }

and call with $this->log->addRecord(Logger::ERROR, '[PORTAL] ' . $message, []);

How can I catch final result of such request and reproduce it on server?

P.S. I will be grateful for any other recommendation for my situation (server not send but local machine - OK)

@zeyser zeyser added the Support label Jun 1, 2023
@stof
Copy link
Contributor

stof commented Jun 1, 2023

I don't think curl supports the Syslog UDP protocol.

@zeyser
Copy link
Author

zeyser commented Jun 1, 2023

@stof What is the best way to check functionality on the server from your point of view in my situation?

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

No branches or pull requests

2 participants