Merge pull request #16022 from grafana/connection-string-log-fix-simple

Only log connection string in dev environment
This commit is contained in:
Carl Bergquist 2019-03-15 14:03:01 +01:00 committed by GitHub
commit 011e8c4a35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 3 deletions

View File

@ -11,6 +11,7 @@
* **Cache**: Adds support for using out of proc caching in the backend [#10816](https://github.com/grafana/grafana/issues/10816) * **Cache**: Adds support for using out of proc caching in the backend [#10816](https://github.com/grafana/grafana/issues/10816)
* **Dataproxy**: Make it possible to add user details to requests sent to the dataproxy [#6359](https://github.com/grafana/grafana/issues/6359) and [#15931](https://github.com/grafana/grafana/issues/15931) * **Dataproxy**: Make it possible to add user details to requests sent to the dataproxy [#6359](https://github.com/grafana/grafana/issues/6359) and [#15931](https://github.com/grafana/grafana/issues/15931)
* **Auth**: Support listing and revoking auth tokens via API [#15836](https://github.com/grafana/grafana/issues/15836) * **Auth**: Support listing and revoking auth tokens via API [#15836](https://github.com/grafana/grafana/issues/15836)
* **Datasource**: Only log connection string in dev environment [#16001](https://github.com/grafana/grafana/issues/16001)
### Bug Fixes ### Bug Fixes
* **Api**: Invalid org invite code [#10506](https://github.com/grafana/grafana/issues/10506) * **Api**: Invalid org invite code [#10506](https://github.com/grafana/grafana/issues/10506)

View File

@ -3,6 +3,7 @@ package mssql
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"github.com/grafana/grafana/pkg/setting"
"strconv" "strconv"
_ "github.com/denisenkom/go-mssqldb" _ "github.com/denisenkom/go-mssqldb"
@ -24,7 +25,9 @@ func newMssqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
if err != nil { if err != nil {
return nil, err return nil, err
} }
logger.Debug("getEngine", "connection", cnnstr) if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{ config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "mssql", DriverName: "mssql",

View File

@ -3,6 +3,7 @@ package mysql
import ( import (
"database/sql" "database/sql"
"fmt" "fmt"
"github.com/grafana/grafana/pkg/setting"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"
@ -44,7 +45,9 @@ func newMysqlQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndpoin
cnnstr += "&tls=" + tlsConfigString cnnstr += "&tls=" + tlsConfigString
} }
logger.Debug("getEngine", "connection", cnnstr) if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{ config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "mysql", DriverName: "mysql",

View File

@ -2,6 +2,7 @@ package postgres
import ( import (
"database/sql" "database/sql"
"github.com/grafana/grafana/pkg/setting"
"net/url" "net/url"
"strconv" "strconv"
@ -19,7 +20,9 @@ func newPostgresQueryEndpoint(datasource *models.DataSource) (tsdb.TsdbQueryEndp
logger := log.New("tsdb.postgres") logger := log.New("tsdb.postgres")
cnnstr := generateConnectionString(datasource) cnnstr := generateConnectionString(datasource)
logger.Debug("getEngine", "connection", cnnstr) if setting.Env == setting.DEV {
logger.Debug("getEngine", "connection", cnnstr)
}
config := tsdb.SqlQueryEndpointConfiguration{ config := tsdb.SqlQueryEndpointConfiguration{
DriverName: "postgres", DriverName: "postgres",