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
269d1630
Commit
269d1630
authored
Jan 11, 2017
by
Ricky Niemi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename to audit logging to data proxy logging
parent
0fee7c86
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
conf/defaults.ini
+2
-2
conf/sample.ini
+1
-1
docs/sources/http_api/admin.md
+1
-1
pkg/api/dataproxy.go
+5
-5
pkg/setting/setting.go
+2
-2
No files found.
conf/defaults.ini
View file @
269d1630
...
@@ -47,8 +47,8 @@ root_url = %(protocol)s://%(domain)s:%(http_port)s/
...
@@ -47,8 +47,8 @@ root_url = %(protocol)s://%(domain)s:%(http_port)s/
# Log web requests
# Log web requests
router_logging
=
false
router_logging
=
false
# This enables
query request audit logging, output at warn level
, default is false
# This enables
data proxy logging
, default is false
audit
_logging
=
false
data_proxy
_logging
=
false
# the path relative working path
# the path relative working path
static_root_path
=
public
static_root_path
=
public
...
...
conf/sample.ini
View file @
269d1630
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
;router_logging = false
;router_logging = false
# This enables query request audit logging, output at warn level, default is false
# This enables query request audit logging, output at warn level, default is false
audit
_logging
=
false
;data_proxy
_logging = false
# the path relative working path
# the path relative working path
;static_root_path = public
;static_root_path = public
...
...
docs/sources/http_api/admin.md
View file @
269d1630
...
@@ -143,7 +143,7 @@ with Grafana admin permission.
...
@@ -143,7 +143,7 @@ with Grafana admin permission.
"protocol":"http",
"protocol":"http",
"root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
"root_url":"%(protocol)s://%(domain)s:%(http_port)s/",
"router_logging":"true",
"router_logging":"true",
"
audit
_logging":"true",
"
data_proxy
_logging":"true",
"static_root_path":"public"
"static_root_path":"public"
},
},
"session":{
"session":{
...
...
pkg/api/dataproxy.go
View file @
269d1630
...
@@ -125,15 +125,15 @@ func ProxyDataSourceRequest(c *middleware.Context) {
...
@@ -125,15 +125,15 @@ func ProxyDataSourceRequest(c *middleware.Context) {
return
return
}
}
audit
Log
(
ds
.
Type
,
c
)
proxy
Log
(
ds
.
Type
,
c
)
proxy
.
ServeHTTP
(
c
.
Resp
,
c
.
Req
.
Request
)
proxy
.
ServeHTTP
(
c
.
Resp
,
c
.
Req
.
Request
)
c
.
Resp
.
Header
()
.
Del
(
"Set-Cookie"
)
c
.
Resp
.
Header
()
.
Del
(
"Set-Cookie"
)
}
}
func
audit
Log
(
dataSourceType
string
,
c
*
middleware
.
Context
)
{
func
proxy
Log
(
dataSourceType
string
,
c
*
middleware
.
Context
)
{
if
setting
.
Audit
Logging
{
if
setting
.
DataProxy
Logging
{
auditLogger
:=
log
.
New
(
"data-proxy-
audit
"
,
"userid"
,
c
.
UserId
,
"orgid"
,
c
.
OrgId
,
"username"
,
c
.
Login
)
auditLogger
:=
log
.
New
(
"data-proxy-
log
"
,
"userid"
,
c
.
UserId
,
"orgid"
,
c
.
OrgId
,
"username"
,
c
.
Login
)
var
body
string
var
body
string
if
c
.
Req
.
Request
.
Body
!=
nil
{
if
c
.
Req
.
Request
.
Body
!=
nil
{
...
@@ -142,6 +142,6 @@ func auditLog(dataSourceType string, c *middleware.Context) {
...
@@ -142,6 +142,6 @@ func auditLog(dataSourceType string, c *middleware.Context) {
body
=
string
(
buffer
)
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
)
}
}
}
}
pkg/setting/setting.go
View file @
269d1630
...
@@ -65,7 +65,7 @@ var (
...
@@ -65,7 +65,7 @@ var (
SshPort
int
SshPort
int
CertFile
,
KeyFile
string
CertFile
,
KeyFile
string
RouterLogging
bool
RouterLogging
bool
Audit
Logging
bool
DataProxy
Logging
bool
StaticRootPath
string
StaticRootPath
string
EnableGzip
bool
EnableGzip
bool
EnforceDomain
bool
EnforceDomain
bool
...
@@ -491,7 +491,7 @@ func NewConfigContext(args *CommandLineArgs) error {
...
@@ -491,7 +491,7 @@ func NewConfigContext(args *CommandLineArgs) error {
HttpAddr
=
server
.
Key
(
"http_addr"
)
.
MustString
(
DEFAULT_HTTP_ADDR
)
HttpAddr
=
server
.
Key
(
"http_addr"
)
.
MustString
(
DEFAULT_HTTP_ADDR
)
HttpPort
=
server
.
Key
(
"http_port"
)
.
MustString
(
"3000"
)
HttpPort
=
server
.
Key
(
"http_port"
)
.
MustString
(
"3000"
)
RouterLogging
=
server
.
Key
(
"router_logging"
)
.
MustBool
(
false
)
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
)
EnableGzip
=
server
.
Key
(
"enable_gzip"
)
.
MustBool
(
false
)
EnforceDomain
=
server
.
Key
(
"enforce_domain"
)
.
MustBool
(
false
)
EnforceDomain
=
server
.
Key
(
"enforce_domain"
)
.
MustBool
(
false
)
StaticRootPath
=
makeAbsolute
(
server
.
Key
(
"static_root_path"
)
.
String
(),
HomePath
)
StaticRootPath
=
makeAbsolute
(
server
.
Key
(
"static_root_path"
)
.
String
(),
HomePath
)
...
...
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