Rename to audit logging to data proxy logging

This commit is contained in:
Ricky Niemi
2017-01-11 07:40:06 -08:00
parent 0fee7c863a
commit 269d16301a
5 changed files with 11 additions and 11 deletions
+5 -5
View File
@@ -125,15 +125,15 @@ func ProxyDataSourceRequest(c *middleware.Context) {
return
}
auditLog(ds.Type, c)
proxyLog(ds.Type, c)
proxy.ServeHTTP(c.Resp, c.Req.Request)
c.Resp.Header().Del("Set-Cookie")
}
func auditLog(dataSourceType string, c *middleware.Context) {
if setting.AuditLogging {
auditLogger := log.New("data-proxy-audit", "userid", c.UserId, "orgid", c.OrgId, "username", c.Login)
func proxyLog(dataSourceType string, c *middleware.Context) {
if setting.DataProxyLogging {
auditLogger := log.New("data-proxy-log", "userid", c.UserId, "orgid", c.OrgId, "username", c.Login)
var body string
if c.Req.Request.Body != nil {
@@ -142,6 +142,6 @@ func auditLog(dataSourceType string, c *middleware.Context) {
body = string(buffer)
}
auditLogger.Warn("Proxying incoming request", "datasource", dataSourceType, "uri", c.Req.RequestURI, "method", c.Req.Request.Method, "body", body)
auditLogger.Info("Proxying incoming request", "datasource", dataSourceType, "uri", c.Req.RequestURI, "method", c.Req.Request.Method, "body", body)
}
}
+2 -2
View File
@@ -65,7 +65,7 @@ var (
SshPort int
CertFile, KeyFile string
RouterLogging bool
AuditLogging bool
DataProxyLogging bool
StaticRootPath string
EnableGzip bool
EnforceDomain bool
@@ -491,7 +491,7 @@ func NewConfigContext(args *CommandLineArgs) error {
HttpAddr = server.Key("http_addr").MustString(DEFAULT_HTTP_ADDR)
HttpPort = server.Key("http_port").MustString("3000")
RouterLogging = server.Key("router_logging").MustBool(false)
AuditLogging = server.Key("audit_logging").MustBool(false)
DataProxyLogging = server.Key("data_proxy_logging").MustBool(false)
EnableGzip = server.Key("enable_gzip").MustBool(false)
EnforceDomain = server.Key("enforce_domain").MustBool(false)
StaticRootPath = makeAbsolute(server.Key("static_root_path").String(), HomePath)