to send logs from php application to graylog using monolog
<p>I have installed graylog server and its dependencies.Trying to send logs from my php application to graylog server using Monolog.
But I am not aware of how to use the Gelf handler.I have seen the GelfHandlerTest.php that is present inside the project Monolog but I am not able to set my publisher and create the handler.Can please anybody explain me with a sample code how to use it.</p>

<p>Trying to send logs from my localhost apache to a server that is set up in the same private network where the graylog is installed.</p>

<p>The testLogging file that is getting executed in PHP are,</p>

<pre><code>use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\GelfHandler;
use Gelf\Message;
use Monolog\Formatter\GelfMessageFormatter;


$handler = new GelfHandler($publisher);
</code></pre>

<p>How to set the publisher in monolog?</p>

<p>Any sort of help is appreciated.Thanks</p>