title: Graylog - Failed to write to socket: fwrite(): send of 136 bytes failed with errno=111 Connection refused (8)
body: <p>I am getting this error when log alert with Gelf logger.</p>
  
  <p><strong>RuntimeException</strong></p>
  
  <pre><code>Failed to write to socket: fwrite(): send of 136 bytes failed with errno=111 Connection refused (8)
  </code></pre>
  
  <p><strong>Code</strong></p>
  
  <pre><code>$transport = new UdpTransport("127.0.0.1", 6379, UdpTransport::CHUNK_SIZE_LAN);
  
  $publisher = new Publisher();
  $publisher-&gt;addTransport($transport);
  
  $message = new \Gelf\Message();
  $message-&gt;setShortMessage("Foobar!")
          -&gt;setLevel(\Psr\Log\LogLevel::ALERT)
          -&gt;setFullMessage("There was a foo in bar")
          -&gt;setFacility("example-facility")
  ;
  
  $publisher-&gt;publish($message);
  
  $logger = new \Gelf\Logger($publisher, "example-facility");
  $logger-&gt;alert("Foobaz!"); //getting error here
  dd($logger);
  </code></pre>
  
  <p>And i am start redis server on this port <code>6379</code>. But don't know why i am getting fwrite issue.</p>