Add nginx.access-log parameter to specific path to access log
This commit is contained in:
parent
6dde4a2a96
commit
438d1d9604
|
@ -15,11 +15,13 @@ func main() {
|
||||||
var (
|
var (
|
||||||
listenAddress = flag.String("net.listen-address", ":2400", "Address to listen on for web and metrics interface")
|
listenAddress = flag.String("net.listen-address", ":2400", "Address to listen on for web and metrics interface")
|
||||||
metricsPath = flag.String("net.telemetry-path", "/metrics", "Path to expose metrics on")
|
metricsPath = flag.String("net.telemetry-path", "/metrics", "Path to expose metrics on")
|
||||||
|
|
||||||
|
nginxAccessLogPath = flag.String("nginx.access-log", "/var/log/nginx/access.log", "Path to nginx access log")
|
||||||
)
|
)
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
nginxExporter, err := NewNginxExporter("/var/log/nginx/access.log")
|
nginxExporter, err := NewNginxExporter(*nginxAccessLogPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue