Skip to content

Commit

Permalink
clean up some old logging (influxdata#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathaniel Cook committed May 19, 2016
1 parent 4767348 commit aa2bdc1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
40 changes: 20 additions & 20 deletions examples/error_percent/error_percent.tick
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
// Get errors batch data
var errors = batch
.query('SELECT sum(value) FROM "pages"."default".errors')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)
|query('SELECT sum(value) FROM "pages"."default".errors')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)

// Get views batch data
var views = batch
.query('SELECT sum(value) FROM "pages"."default".views')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)
|query('SELECT sum(value) FROM "pages"."default".views')
.period(1h)
.every(1h)
.groupBy(time(1m), *)
.fill(0)

// Join errors and views
errors.join(views)
.as('errors', 'views')
//Calculate percentage
.eval(lambda: "errors.sum" / ("views.sum" + "errors.sum"))
// Give the resulting field a name
.as('value')
.influxDBOut()
.database('pages')
.measurement('error_percent')

errors
|join(views)
.as('errors', 'views')
// Calculate percentage
|eval(lambda: "errors.sum" / ("views.sum" + "errors.sum"))
// Give the resulting field a name
.as('value')
|influxDBOut()
.database('pages')
.measurement('error_percent')
2 changes: 0 additions & 2 deletions services/influxdb/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,6 @@ func getTLSConfig(
}
if SSLCert != "" && SSLKey != "" {
cert, err := tls.LoadX509KeyPair(SSLCert, SSLKey)
log.Println(SSLCert, SSLKey)

if err != nil {
return nil, fmt.Errorf(
"Could not load TLS client key/certificate: %s",
Expand Down
5 changes: 5 additions & 0 deletions services/logging/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func (s *Service) Open() error {
s.f = f
}

// Configure default logger
log.SetPrefix("[log] ")
log.SetFlags(log.LstdFlags)
log.SetOutput(wlog.NewWriter(s.f))

wlog.SetLevelFromName(s.c.Level)
return nil
}
Expand Down

0 comments on commit aa2bdc1

Please sign in to comment.