I'm trying to listen to UDP socket port 514 in order to catch the logs coming from the server. The problem is that the team

echo “hello” > /dev/udp/192.168.5.52/514 

I get the data, but when the real logs are sent, there is nothing. In the settings syslog.conf indicated

 *.* @127.0.0.1:514 

The log receiving program itself is taken from the qt documentation:

 void Server::initSocket() { udpSocket = new QUdpSocket(this); udpSocket->bind(QHostAddress::LocalHost, 514); connect(udpSocket, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams())); } void Server::readPendingDatagrams() { while (udpSocket->hasPendingDatagrams()) { QByteArray datagram; datagram.resize(udpSocket->pendingDatagramSize()); QHostAddress sender; quint16 senderPort; udpSocket->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort); processTheDatagram(datagram); } } 
  • From the question it is not clear whether the problems with the syslog configuration, or with the code that resulted, are copied one by one from the docks. - alexis031182
  • Start by running wireshark. To see firsthand how the packets are going. - gbg

0