From 378f7aa3409d19cb3a5ce14a5a24741cad3cedef Mon Sep 17 00:00:00 2001 From: Jonathan Robertson <5396045+jonathan-robertson@users.noreply.github.com> Date: Sun, 24 Sep 2017 14:49:34 -0500 Subject: [PATCH] Add quickstart near top --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d1ddac4..2251300 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,14 @@ `go get -u github.com/sirupsen/logrus github.com/jonathan-robertson/logentrus` +## Quickstart + +For someone already familiar with Logrus and Logentries (assuming you like the [default options](https://github.com/jonathan-robertson/logentrus#default-options)), this is the only line you need: + +```go +hook, err := logentrus.New(logentriesToken, nil) +``` + ## Setup First, you should get a token for your logentries account, which you'll need to feed into your app somehow. @@ -59,6 +67,8 @@ func main() { } ``` +### Options + Each field in logentrus.Opts is entirely optional and will have some default value if necessary. Option | Description | Default | Valid options @@ -70,12 +80,6 @@ UnencryptedTCP | `true` to disable encryption and still use TCP | `false` | `tru UnencryptedUDP | `true` this to disable encryption and use UDP | `false` | `true` / `false` UnencryptedPort | if using an unencrypted connection, choose a port here | `514` | `80`, `514`, and `10000` -Note that the entire logentrus.Opts param is optional as well. So if you're happy with the defaults, just enter `nil` as shown below: - -```go -hook, err := logentrus.New(logentriesToken, nil) -``` - ## Features ### Logentrus does its own formatting