Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
dd84fb56
Commit
dd84fb56
authored
Jan 16, 2017
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(dataproxy): renames log functions
parent
51bca7d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
pkg/api/dataproxy.go
+15
-14
No files found.
pkg/api/dataproxy.go
View file @
dd84fb56
...
...
@@ -19,7 +19,7 @@ import (
)
var
(
audit
Logger
log
.
Logger
=
log
.
New
(
"data-proxy-log"
)
dataproxy
Logger
log
.
Logger
=
log
.
New
(
"data-proxy-log"
)
)
func
NewReverseProxy
(
ds
*
m
.
DataSource
,
proxyPath
string
,
targetUrl
*
url
.
URL
)
*
httputil
.
ReverseProxy
{
...
...
@@ -129,14 +129,15 @@ func ProxyDataSourceRequest(c *middleware.Context) {
return
}
proxyLog
(
ds
.
Type
,
c
)
logProxyRequest
(
ds
.
Type
,
c
)
proxy
.
ServeHTTP
(
c
.
Resp
,
c
.
Req
.
Request
)
c
.
Resp
.
Header
()
.
Del
(
"Set-Cookie"
)
}
func
proxyLog
(
dataSourceType
string
,
c
*
middleware
.
Context
)
{
if
setting
.
DataProxyLogging
{
func
logProxyRequest
(
dataSourceType
string
,
c
*
middleware
.
Context
)
{
if
!
setting
.
DataProxyLogging
{
return
}
var
body
string
if
c
.
Req
.
Request
.
Body
!=
nil
{
...
...
@@ -144,14 +145,14 @@ func proxyLog(dataSourceType string, c *middleware.Context) {
c
.
Req
.
Request
.
Body
=
ioutil
.
NopCloser
(
bytes
.
NewBuffer
(
buffer
))
body
=
string
(
buffer
)
}
auditLogger
.
Info
(
"Proxying incoming request"
,
"userid"
,
c
.
UserId
,
"orgid"
,
c
.
OrgId
,
"username"
,
c
.
Login
,
"datasource"
,
dataSourceType
,
"uri"
,
c
.
Req
.
RequestURI
,
"method"
,
c
.
Req
.
Request
.
Method
,
"body"
,
body
)
}
dataproxyLogger
.
Info
(
"Proxying incoming request"
,
"userid"
,
c
.
UserId
,
"orgid"
,
c
.
OrgId
,
"username"
,
c
.
Login
,
"datasource"
,
dataSourceType
,
"uri"
,
c
.
Req
.
RequestURI
,
"method"
,
c
.
Req
.
Request
.
Method
,
"body"
,
body
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment