Skip to content

Commit

Permalink
Update default ports to supplement #3
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton committed May 18, 2017
1 parent d6a61fc commit 4dd2eda
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ logvac -s
logvac add-token -t TOKEN

# add a log via http
curl -k https://127.0.0.1:1234 -H "X-USER-TOKEN: TOKEN" \
curl -k https://127.0.0.1:6360 -H "X-USER-TOKEN: TOKEN" \
-d '{"id":"log-test", "type":"log", "message":"my first log"}'

# view log via http
curl -k "https://127.0.0.1:1234?type=log&auth=TOKEN"
curl -k "https://127.0.0.1:6360?type=log&auth=TOKEN"

# Congratulations logmaster!
```
Expand All @@ -33,7 +33,7 @@ curl -k "https://127.0.0.1:1234?type=log&auth=TOKEN"
`logvac add-token -t TOKEN`

- If your logs aren't showing up where you think they should, try checking the 'app' type and see if they are there. By default logvac will log to `type=app` (unless changed via config options). If you have a malformed entry (even with a type specified) it will end up there:
`curl -k "https://127.0.0.1:1234?type=app&auth=TOKEN"`
`curl -k "https://127.0.0.1:6360?type=app&auth=TOKEN"`

## Usage
```
Expand All @@ -55,9 +55,9 @@ Flags:
-C, --cors-allow string Sets the 'Access-Control-Allow-Origin' header (default "*")
-d, --db-address string Log storage address (default "boltdb:///var/db/logvac.bolt")
-i, --insecure Don't use TLS (used for testing)
-a, --listen-http string API listen address (same endpoint for http log collection) (default "127.0.0.1:1234")
-t, --listen-tcp string TCP log collection endpoint (default "127.0.0.1:1235")
-u, --listen-udp string UDP log collection endpoint (default "127.0.0.1:1234")
-a, --listen-http string API listen address (same endpoint for http log collection) (default "127.0.0.1:6360")
-t, --listen-tcp string TCP log collection endpoint (default "127.0.0.1:6361")
-u, --listen-udp string UDP log collection endpoint (default "127.0.0.1:514")
-k, --log-keep string Age or number of logs to keep per type '{"app":"2w", "deploy": 10}'' (int or X(m)in, (h)our, (d)ay, (w)eek, (y)ear) (default "{\"app\":\"2w\"}")
-l, --log-level string Level at which to log (default "info")
-L, --log-type string Default type to apply to incoming logs (commonly used: app|deploy) (default "app")
Expand All @@ -72,9 +72,9 @@ Config File: (takes precedence over cli flags)
```json
// logvac.json
{
"listen-http": "127.0.0.1:1234",
"listen-udp": "127.0.0.1:1234",
"listen-tcp": "127.0.0.1:1235",
"listen-http": "127.0.0.1:6360",
"listen-udp": "127.0.0.1:514",
"listen-tcp": "127.0.0.1:6361",
"pub-address": "",
"pub-auth": "",
"db-address": "boltdb:///var/db/logvac.bolt",
Expand Down
12 changes: 6 additions & 6 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,38 +54,38 @@ Note: * = required on submit

add auth key - attempt
```
$ curl -ik https://localhost:1234/add-key -H 'X-USER-TOKEN: user'
$ curl -ik https://localhost:6360/add-key -H 'X-USER-TOKEN: user'
HTTP/1.1 401 Unauthorized
```

add auth key - success
```
$ curl -ik https://localhost:1234/add-key -H 'X-USER-TOKEN: user' -H 'X-AUTH-TOKEN: secret'
$ curl -ik https://localhost:6360/add-key -H 'X-USER-TOKEN: user' -H 'X-AUTH-TOKEN: secret'
HTTP/1.1 200 OK
```

publish log - attempt
```
$ curl -ik https://localhost:1234 -d '{"id":"my-app","type":"deploy","message":"$ mv nanobox/.htaccess .htaccess\n[✓] SUCCESS"}'
$ curl -ik https://localhost:6360 -d '{"id":"my-app","type":"deploy","message":"$ mv nanobox/.htaccess .htaccess\n[✓] SUCCESS"}'
HTTP/1.1 401 Unauthorized
```

publish log - success
```
$ curl -ik https://localhost:1234 -H 'X-USER-TOKEN: user' -d '{"id":"my-app","type":"deploy","message":"$ mv nanobox/.htaccess .htaccess\n[✓] SUCCESS"}'
$ curl -ik https://localhost:6360 -H 'X-USER-TOKEN: user' -d '{"id":"my-app","type":"deploy","message":"$ mv nanobox/.htaccess .htaccess\n[✓] SUCCESS"}'
sucess!
HTTP/1.1 200 OK
```

get deploy logs
```
$ curl -k https://localhost:1234?kind=deploy -H 'X-USER-TOKEN: user'
$ curl -k https://localhost:6360?kind=deploy -H 'X-USER-TOKEN: user'
[{"time":"2016-03-07T15:48:57.668893791-07:00","id":"my-app","tag":"","type":"deploy","priority":0,"message":"$ mv nanobox/.htaccess .htaccess\n[✓] SUCCESS"}]
```

get app logs
```
$ curl -k https://localhost:1234 -H 'X-USER-TOKEN: user'
$ curl -k https://localhost:6360 -H 'X-USER-TOKEN: user'
[]
```

Expand Down
4 changes: 2 additions & 2 deletions collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Logvac can receive logs from rsyslog
>```
# rsyslog.conf style - more info look at rsyslog.conf(5)
# Single '@' sends to UDP
*.* @127.0.0.1:1234
*.* @127.0.0.1:514
# Double '@' sends to TCP
*.* @@127.0.0.1:1235
*.* @@127.0.0.1:6361
```
> `sudo service rsyslog restart` with the preceding config file should start dumping logs to logvac
Expand Down
6 changes: 3 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

var (
// collectors
ListenHttp = "127.0.0.1:1234" // address the api and http log collectors listen on
ListenUdp = "127.0.0.1:1234" // address the udp log collector listens on
ListenTcp = "127.0.0.1:1235" // address the tcp log collector listens on
ListenHttp = "127.0.0.1:6360" // address the api and http log collectors listen on
ListenUdp = "127.0.0.1:514" // address the udp log collector listens on
ListenTcp = "127.0.0.1:6361" // address the tcp log collector listens on

// drains
PubAddress = "" // publisher address // mist://127.0.0.1:1445
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
// -C, --cors-allow string Sets the 'Access-Control-Allow-Origin' header (default "*")
// -d, --db-address string Log storage address (default "boltdb:///var/db/logvac.bolt")
// -i, --insecure Don't use TLS (used for testing)
// -a, --listen-http string API listen address (same endpoint for http log collection) (default "127.0.0.1:1234")
// -t, --listen-tcp string TCP log collection endpoint (default "127.0.0.1:1235")
// -u, --listen-udp string UDP log collection endpoint (default "127.0.0.1:1234")
// -a, --listen-http string API listen address (same endpoint for http log collection) (default "127.0.0.1:6360")
// -t, --listen-tcp string TCP log collection endpoint (default "127.0.0.1:6361")
// -u, --listen-udp string UDP log collection endpoint (default "127.0.0.1:514")
// -k, --log-keep string Age or number of logs to keep per type '{"app":"2w", "deploy": 10}' (int or X(m)in, (h)our, (d)ay, (w)eek, (y)ear) (default "{\"app\":\"2w\"}")
// -l, --log-level string Level at which to log (default "info")
// -L, --log-type string Default type to apply to incoming logs (commonly used: app|deploy) (default "app")
Expand Down

0 comments on commit 4dd2eda

Please sign in to comment.