Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Oct 30, 2023
1 parent 1462290 commit e7c4cd5
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,36 @@ w, err := DialWithCustomDialer("custom", "192.168.0.52:514", syslog.LOG_ERR, "te

Your custom dial func can set timeouts, proxy connections, and do whatever else it needs before returning a net.Conn.

## Custom config

Set custom formatter

```golang
w, err := syslog.Dial("", "", syslog.LOG_ERR, "test")
w.SetFormatter(syslog.RFC3164Formatter)
```

Set custom framer

```golang
w, err := syslog.Dial("", "", syslog.LOG_ERR, "test")
w.SetFramer(syslog.RFC5425MessageLengthFramer)
```

Set custom hostname

```golang
w, err := syslog.Dial("", "", syslog.LOG_ERR, "test")
w.SetHostname("hostname")
```

Set custom program name

```golang
w, err := syslog.Dial("", "", syslog.LOG_ERR, "test")
w.SetProgram("program")
```

## Running Tests

Run the tests as usual:
Expand Down

0 comments on commit e7c4cd5

Please sign in to comment.