s-u / ulog

Facititate logging into ulog or syslog daemons from R
3 stars 3 forks source link

Logging via TCP doesn't work #3

Closed dselivanov closed 3 years ago

dselivanov commented 6 years ago

Hi Simon. It looks like logging via tcp protocol doesn't work. I'm running local rsyslog with simple configuration:

$ModLoad imudp
$UDPServerRun 5515
$ModLoad imtcp
$InputTCPServerRun 5515
action(type="omfile" file="/home/dselivanov/rserve.log")

And sending messages with:

library(ulog)
ulog.init(path = "udp://127.0.0.1:5515", application = "myapp")
ulog("hello from R - udp")

However when I send messages via tcp they are not delivered:

library(ulog)
ulog.init(path = "tcp://127.0.0.1:5515", application = "myapp")
ulog("hello from R - tcp")

Also I see following when sending first message:

Error in ulog("hello from R - tcp") : ignoring SIGPIPE signal

Any thoughts/tips on how to debug what is going wrong? will be happy to fix and send PR (udp works great, but unfortunately not reliable - in certain scenarios I'm loosing ~50% of the messages).

dselivanov commented 6 years ago

For now as a workaround I write to local unix socket and then local rsyslog forwards everything to central rsyslog via tcp.

s-u commented 3 years ago

@dselivanov I think this should be now fixed - please check, thanks.