Remote defines a logger that writes events to a generic remote server. It can write to a local or a remote daemon, UDP or TCP. It supports writing events in RFC5424, RFC3164, CSV and JSON formats.
| 41 | // It can write to a local or a remote daemon, UDP or TCP. |
| 42 | // It supports writing events in RFC5424, RFC3164, CSV and JSON formats. |
| 43 | type Remote struct { |
| 44 | mu *sync.RWMutex |
| 45 | Writer *syslog.Writer |
| 46 | cfg LoggerConfig |
| 47 | ctx context.Context |
| 48 | cancel context.CancelFunc |
| 49 | logFormat formats.LoggerFormat |
| 50 | |
| 51 | // Name of the logger |
| 52 | Name string |
| 53 | |
| 54 | // channel used to write mesages |
| 55 | writerChan chan string |
| 56 | |
| 57 | Tag string |
| 58 | |
| 59 | // Name of the host where the daemon is running |
| 60 | Hostname string |
| 61 | |
| 62 | // Write timeouts |
| 63 | Timeout time.Duration |
| 64 | |
| 65 | // Connect timeout |
| 66 | ConnectTimeout time.Duration |
| 67 | |
| 68 | status uint32 |
| 69 | } |
| 70 | |
| 71 | // NewRemote returns a new object that manipulates and prints outbound connections |
| 72 | // to a remote server, with the given format (RFC5424 by default) |
nothing calls this directly
no outgoing calls
no test coverage detected