Skip to content

Commit

Permalink
Add quickstart near top
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-robertson committed Sep 24, 2017
1 parent f05b492 commit 378f7aa
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 378f7aa

Please sign in to comment.