Connect to goxe
Once goxe is configured, the next step is to connect your applications or services so they can send logs to it.
By default, goxe listens on udp port 1729. this can be changed in the config.json file if needed. make sure that all applications sending logs are configured to use the same port.
Configuring applications to send logs to goxe
Section titled “Configuring applications to send logs to goxe”Below are examples of how to configure common applications and services to send logs to goxe.
Syslog (Linux)
Section titled “Syslog (Linux)”If you are using syslog on a linux system, add the following line to your syslog configuration file (for example, /etc/rsyslog.conf):
*.* @localhost:1729;RSYSLOG_SyslogProtocol23FormatAfter applying the change, restart the syslog service:
sudo systemctl restart rsyslogWindows event log
Section titled “Windows event log”On windows, you can use nxlog to forward event logs to goxe. below is an example configuration:
<Input in> Module im_msvistalog</Input>
<Output out> Module om_udp Host localhost Port 1729</Output>
<Route 1> Path in => out</Route>Restart the nxlog service to apply the configuration:
net stop nxlognet start nxlogSyslog (MacOS)
Section titled “Syslog (MacOS)”On macos, syslog uses a similar configuration file to linux, but the service is managed with launchctl. add the following line to /etc/syslog.conf:
*.* @localhost:1729Restart the syslog service:
sudo launchctl stop com.apple.syslogdsudo launchctl start com.apple.syslogdTo send nginx logs to goxe, use the built-in syslog support. add the following lines to your nginx configuration file (for example, /etc/nginx/nginx.conf):
error_log syslog:server=localhost:1729;access_log syslog:server=localhost:1729 combined;Restart nginx to apply the changes:
sudo systemctl restart nginxCustom Applications
Section titled “Custom Applications”Custom applications can send logs to goxe using udp.
Example using python:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)log_message = "test log message"sock.sendto(log_message.encode(), ("localhost", 1729))Example using node.js:
const dgram = require('dgram');const message = Buffer.from('test log message');const client = dgram.createSocket('udp4');
client.send(message, 1729, 'localhost', () => { client.close();});Example using go:
package main
import ( "log" "net")
func main() { conn, err := net.Dial("udp", "localhost:1729") if err != nil { log.Fatal(err) } defer conn.Close()
logMessage := "test log message" _, err = conn.Write([]byte(logMessage)) if err != nil { log.Fatal(err) }}Regardless of the application or service used, goxe will process any logs it receives according to the rules defined in config.json.
Goxe does not provide immediate feedback when logs are received. it is designed to run silently and avoid terminal noise. if goxe is running and logs are being sent correctly, it is operating as expected.