Log messages over HTTP to graylog
nessor opened this issue · 5 comments
Hey @hedii ,
you wrote that you "only" wrote a wrapper for the package bzikarsky/gelf-php for Laravel. The readme of gelf-php says that it is also possible to send GELF over HTTP I'm trying to get this working with your package for quite some time now, but unfortunately without success so far. 'transport' => 'http' seems not to work either.
Is it possible that the wrapper does not offer this or that there is no mapping to bzikarsky/gelf-php? I haven't really looked into your code yet.
-Florian
maybe this is a simple solution?:
protected function getTransport(string $transport, string $host, int $port): AbstractTransport
{
switch ($transport) {
case 'tcp':
return new TcpTransport($host, $port);
case 'http':
return new HttpTransport($host, $port);
default:
return new UdpTransport($host, $port);
}
}
Hi,
Http transport is not supported right now.
Please fork the repo, try to implement it and write some tests to see if it works.
If everything is ok and all tests pass, open a pull request and I'll merge this into master.
maybe this is a simple solution?
A good starting point, yes. Maybe it will work as is.
@nessor did that work for you? because for me it didn't....
@HighCoData the simple exchange unfortunately not. I think that you have to do 1-2 small things more. But unfortunately I have so incredibly limited time at the moment (thanks Corona). Otherwise I would have already done an MR.
I don't have a graylog instance accepting http messages, so I cannot write the http implementation myself.
I would be happy to merge an http transport implementation if someone can write it and test it.
I think you have to add config values for username and password for it to work?