Geal / rust-syslog

Send syslog messages from Rust
MIT License
110 stars 55 forks source link

issues on sending logs to tcp #63

Closed sify21 closed 3 months ago

sify21 commented 2 years ago
  1. can't integrate with the log crate when using tcp (unix is ok).

I debugged this by starting rsyslog with rsyslogd -dn, the output shows imtcp accepted the connection, but no log entry is added. I suspect that logs are not sent when using info! from log crate.

  1. when using logger.info(...), must manually add '\n' at the end of every message.
  2. time is not local
franklx commented 2 years ago

TCP Socket is not suitable for log macros (info!, debug!, etc) because is a stream transport: a flush() call is needed for the logs to be sent but the log macros doesn't call it. You should use the UDP transports that sends log data line-by-line and works as expected. Maybe this should be pointed up in documentation.

Roguelazer commented 2 years ago

See #70 for a proposed fix

Geal commented 3 months ago

fixed by #70