Commit Graph

41 Commits

Author SHA1 Message Date
Leonard Gram
5d87aa2fa4
Merge pull request #13031 from bergquist/golang_1.11
upgrade to golang 1.11
2018-09-05 15:31:43 +02:00
maicon
a6aa219895 Reopen log files after receiving a SIGHUP signal (#13112)
* Reopen log files after receiving a SIGHUP signal

Implements a system signals listener in log.FileLogWriter.

After receiving a SIGHUP signal from the system, the listener will close the current log file and then open it again.

The listener will finishes after receiving a SIGINT, SIGKILL or SIGTERM signal.

Closes grafana/grafana#2497

* Move the SIGHUP handling to the main file
2018-09-04 10:31:41 +02:00
bergquist
12c9860882 string formating fixes 2018-08-28 22:33:38 +02:00
Mario Trangoni
bc570bb140 pkg/log: fix ineffassign issues 2018-04-23 19:31:23 +02:00
Karsten Weiss
be2d635078 Simplify error returns (gosimple)
This fixes:
pkg/api/avatar/avatar.go:261:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/log/file.go:102:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/metrics/graphitebridge/graphite.go:298:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/provisioning/provisioning.go:23:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/alert_notification.go:27:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/annotation.go:105:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:351:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard.go:435:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/dashboard_acl.go:38:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/stats.go:22:2: 'if err != nil { return err }; return err' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/team.go:213:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:256:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:274:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
pkg/services/sqlstore/user.go:482:3: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013)
2018-04-16 21:04:57 +02:00
Mikael Olenfalk
c0f100f1b5 Improve logging in the phantomjs renderer (#10697)
* Add add adapter between io.Writer and log.Logger

* Add phantomjs output to grafana log

* Unexport LogWriterImpl

* Add test for LogWriter

* Make it possible to get phantomjs debug output

* Make it possible to get the configured log level
2018-02-01 14:04:52 +01:00
bergquist
50db9810e8 uses pluginmanagers log instead of global 2018-01-10 11:49:40 +01:00
bergquist
c0e087640b test: close file before deleting 2017-11-28 15:05:53 +01:00
THIERRY SALLE
658109e0d6 Optimized number of lines fetching in log file initialisation
Added unit tests for file logging line counting

Remove file after unit test
2017-11-22 14:25:39 +01:00
stuart nelson
93ac6680ab update log15 (#9622)
* Update log15 and go-isatty

* Update usage in pkg log
2017-10-23 19:57:19 +02:00
Dan Cech
b489e93d94 Config Array Syntax (#8204)
* refactor util encryption library so it doesn't have to import log

* add util.SplitString to handle space and/or comma-separated config lines

* go fmt
2017-04-25 09:14:29 +02:00
Dan Cech
3a607f96a3 fix bug in log sprintf calls (#8124) 2017-04-14 07:45:36 +02:00
Torkel Ödegaard
94962b4193 fix(logging): fixed default log level filter option not taking effect, fixex #6978 2016-12-15 13:54:47 +01:00
bergquist
7a6501640f tech(log): fixes extra param logging 2016-09-28 13:57:19 +02:00
bergquist
99c77e7df8 tech(plugins): increase timeout 2016-09-23 09:56:42 +02:00
Torkel Ödegaard
0d9b98da6d feat(alerting): progress on email notifications 2016-07-26 12:29:52 +02:00
bergquist
1771ab032e Merge branch 'master' into alerting 2016-06-17 07:44:21 +02:00
Torkel Ödegaard
32479503bd fix(build): another windows build issue 2016-06-16 21:10:30 +02:00
Torkel Ödegaard
b06ec734f1 fix(build): windows, another windows build fix, #5370 2016-06-16 18:21:12 +02:00
bergquist
8ec311ade4 Merge branch 'master' into alerting 2016-06-16 16:29:41 +02:00
Torkel Ödegaard
b039a81375 feat(build): fixing windows build issue, #5370 2016-06-16 14:36:19 +02:00
Torkel Ödegaard
71c1c0ab65 feat(alerting): trying to get things to work with new model 2016-06-11 13:49:11 +02:00
Torkel Ödegaard
086b59483e feat(loggin): disable logging by default so unit tests are not full of logging 2016-06-11 11:38:25 +02:00
Torkel Ödegaard
1d8fdc09e7 feat(logging): added log format option, #4590 2016-06-08 08:48:46 +02:00
Torkel Ödegaard
87e98f01cd feat(logging): updated syslog writer to work with log15 log interface, closes #4590 2016-06-08 08:09:29 +02:00
Torkel Ödegaard
65aad44464 feat(logging): added uname to context logger 2016-06-07 12:20:46 +02:00
Torkel Ödegaard
a02cf5beb7 feat(logging): added loging filters 2016-06-07 12:11:41 +02:00
Torkel Ödegaard
3dc7706c45 feat(loggin): improved http request panic handling 2016-06-07 10:05:10 +02:00
Torkel Ödegaard
22778e6efd feat(logging): a lot of progress on moving to new logging lib, #4590 2016-06-06 23:06:44 +02:00
Dieter Plaetinck
5d7d165be5 allow setting level on logger.
performance workaround, see https://github.com/grafana/grafana/issues/4055
2016-02-18 16:46:47 +11:00
Dieter Plaetinck
fbc90e038c prevent needless cpu burning in unused levels. fix #3898 2016-02-01 17:49:37 +13:00
Dieter Plaetinck
bf943ddba3 actually make use of the LogLevel type
why else would it be defined?
and this is sane anyway.
2016-02-01 17:48:42 +13:00
Torkel Ödegaard
b63471ebe9 fix(windows): exclude syslog feature from windows builds 2015-12-14 16:16:36 +01:00
Nick Owens
0bff097afb pkg/log: implement syslog logger 2015-11-07 18:34:55 -08:00
ctdk
d37e18fdcf Add config option to strip (most) colors from console logs 2015-10-01 13:16:23 -07:00
woodsaj
c138f390ac close all existing loggers before re-initilizing loggers. fixes #2533 2015-08-17 15:59:40 +08:00
Mark Bell
e59ea1aa02 Change log file permissions from 0660 to 0644 2015-08-08 23:06:30 -04:00
Torkel Ödegaard
7e0f1a57af Progress on deb and rpm packaging, renamed config files, added file logging, #1476 2015-03-03 10:18:37 +01:00
Jason Wilder
c1d4acc01e CLI: Use colorized console output
This extracts some of the colored logging functionality into some
convenience functions to log directly to the console (stdout) w/o
the usual logging prefixes and flags.  It's intended for console
messages when using grafana commands.
2015-02-15 13:36:10 -07:00
Jason Wilder
7d4c319fcb CLI: Default logging output to stderr instead of stdout
Makes it possible to separate console output from logging output so
command output can be piped to a file cleanly.
2015-02-15 13:36:10 -07:00
Torkel Ödegaard
a4204880e8 started work on new arch 2014-10-04 13:33:20 +02:00