diff --git a/cmd/nginx-ingress/flags.go b/cmd/nginx-ingress/flags.go
index 868853891e..e1b3f92fa7 100644
--- a/cmd/nginx-ingress/flags.go
+++ b/cmd/nginx-ingress/flags.go
@@ -265,15 +265,6 @@ func initValidate(ctx context.Context) {
func mustValidateInitialChecks(ctx context.Context) {
l := nl.LoggerFromContext(ctx)
- err := flag.Lookup("logtostderr").Value.Set("true")
- if err != nil {
- nl.Fatalf(l, "Error setting logtostderr to true: %v", err)
- }
-
- err = flag.Lookup("include_year").Value.Set("true")
- if err != nil {
- nl.Fatalf(l, "Error setting include_year flag: %v", err)
- }
if startupCheckFn != nil {
err := startupCheckFn()
diff --git a/deployments/daemon-set/nginx-ingress.yaml b/deployments/daemon-set/nginx-ingress.yaml
index 62c673f8cb..9af683823c 100644
--- a/deployments/daemon-set/nginx-ingress.yaml
+++ b/deployments/daemon-set/nginx-ingress.yaml
@@ -91,7 +91,8 @@ spec:
- -report-ingress-status
- -external-service=nginx-ingress
#- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
- #- -v=3 # Enables extensive logging. Useful for troubleshooting.
+ #- -log-level=debug # Enables extensive logging. Useful for troubleshooting. Options include: trace, debug, info, warning, error, fatal
+ #- -log-format=glog # Sets the log format. Options include: glog, json, text
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
# initContainers:
diff --git a/deployments/daemon-set/nginx-plus-ingress.yaml b/deployments/daemon-set/nginx-plus-ingress.yaml
index e564a95076..a6074eeec1 100644
--- a/deployments/daemon-set/nginx-plus-ingress.yaml
+++ b/deployments/daemon-set/nginx-plus-ingress.yaml
@@ -94,7 +94,8 @@ spec:
#- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -enable-app-protect
#- -enable-app-protect-dos
- #- -v=3 # Enables extensive logging. Useful for troubleshooting.
+ #- -log-level=debug # Enables extensive logging. Useful for troubleshooting. Options include: trace, debug, info, warning, error, fatal
+ #- -log-format=glog # Sets the log format. Options include: glog, json, text
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
# initContainers:
diff --git a/deployments/deployment/nginx-ingress.yaml b/deployments/deployment/nginx-ingress.yaml
index 845186780d..23b72567fd 100644
--- a/deployments/deployment/nginx-ingress.yaml
+++ b/deployments/deployment/nginx-ingress.yaml
@@ -92,7 +92,8 @@ spec:
#- -default-server-tls-secret=$(POD_NAMESPACE)/default-server-secret
#- -enable-cert-manager
#- -enable-external-dns
- #- -v=3 # Enables extensive logging. Useful for troubleshooting.
+ #- -log-level=debug # Enables extensive logging. Useful for troubleshooting. Options include: trace, debug, info, warning, error, fatal
+ #- -log-format=glog # Sets the log format. Options include: glog, json, text
#- -enable-prometheus-metrics
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
# initContainers:
diff --git a/deployments/deployment/nginx-plus-ingress.yaml b/deployments/deployment/nginx-plus-ingress.yaml
index 030286397b..8579ba7f1a 100644
--- a/deployments/deployment/nginx-plus-ingress.yaml
+++ b/deployments/deployment/nginx-plus-ingress.yaml
@@ -97,7 +97,8 @@ spec:
#- -enable-external-dns
#- -enable-app-protect
#- -enable-app-protect-dos
- #- -v=3 # Enables extensive logging. Useful for troubleshooting.
+ #- -log-level=debug # Enables extensive logging. Useful for troubleshooting. Options include: trace, debug, info, warning, error, fatal
+ #- -log-format=glog # Sets the log format. Options include: glog, json, text
#- -enable-prometheus-metrics
#- -enable-service-insight
#- -global-configuration=$(POD_NAMESPACE)/nginx-configuration
diff --git a/examples/shared-examples/usage-reporting/cluster-connector.yaml b/examples/shared-examples/usage-reporting/cluster-connector.yaml
index 005d977ae3..f8e07983ce 100644
--- a/examples/shared-examples/usage-reporting/cluster-connector.yaml
+++ b/examples/shared-examples/usage-reporting/cluster-connector.yaml
@@ -140,6 +140,7 @@ spec:
- -nms-server-address=https://apigw.nms.svc.cluster.local:443/api/platform/v1
- -nms-basic-auth-secret=nginx-cluster-connector/nms-basic-auth
# - -cluster-display-name=my-cluster
-# - -v=3
+# - -log-level=debug
+# - -log-format=glog
# - -skip-tls-verify
# - -min-update-interval=24h
diff --git a/internal/telemetry/collector_test.go b/internal/telemetry/collector_test.go
index cfff7157ef..be4ec305b1 100644
--- a/internal/telemetry/collector_test.go
+++ b/internal/telemetry/collector_test.go
@@ -1056,21 +1056,21 @@ func TestCollectInstallationFlags(t *testing.T) {
{
name: "second flag",
setFlags: []string{
- "-v=3",
+ "-log-level=debug",
},
wantFlags: []string{
- "-v=3",
+ "-log-level=debug",
},
},
{
name: "multiple flags",
setFlags: []string{
"nginx-plus=true",
- "-v=3",
+ "-log-level=debug",
},
wantFlags: []string{
"nginx-plus=true",
- "-v=3",
+ "-log-level=debug",
},
},
{
diff --git a/site/content/configuration/global-configuration/command-line-arguments.md b/site/content/configuration/global-configuration/command-line-arguments.md
index 713cef15b0..3436c26a82 100644
--- a/site/content/configuration/global-configuration/command-line-arguments.md
+++ b/site/content/configuration/global-configuration/command-line-arguments.md
@@ -316,14 +316,6 @@ Path to the TransportServer NGINX configuration template for a TransportServer r
- Default for NGINX is `nginx.transportserver.tmpl`.
- Default for NGINX Plus is `nginx-plus.transportserver.tmpl`.
-
-
----
-
-### -v ``
-
-Log level for V logs.
-
---
diff --git a/site/content/logging-and-monitoring/logging.md b/site/content/logging-and-monitoring/logging.md
index fba0c1e12c..44e7a8fb20 100644
--- a/site/content/logging-and-monitoring/logging.md
+++ b/site/content/logging-and-monitoring/logging.md
@@ -9,17 +9,17 @@ weight: 1800
This document gives an overview of logging provided by NGINX Ingress Controller.
-NGINX Ingress Controller exposes the logs of the Ingress Controller process (the process that generates NGINX configuration and reloads NGINX to apply it) and NGINX access and error logs. All logs are sent to the standard output and error of the Ingress Controller process. To view the logs, you can execute the `kubectl logs` command for an Ingress Controller pod. For example:
+NGINX Ingress Controller exposes the logs of the Ingress Controller process (the process that generates NGINX configuration and reloads NGINX to apply it) and NGINX access and error logs. All logs are sent to the standard output and error of the NGINX Ingress Controller process. To view the logs, you can execute the `kubectl logs` command for an Ingress Controller pod. For example:
```shell
kubectl logs -n nginx-ingress
```
-## Ingress Controller Process Logs
+## NGINX Ingress Controller Process Logs
-The Ingress Controller process logs are configured through the `-v` command-line argument of the Ingress Controller, which sets the log verbosity level. The default value is `1`, for which the minimum amount of logs is reported. The value `3` is useful for troubleshooting: you will be able to see how the Ingress Controller gets updates from the Kubernetes API, generates NGINX configuration and reloads NGINX.
+The NGINX Ingress Controller process logs are configured through the `-log-level` command-line argument of the NGINX Ingress Controller, which sets the log level. The default value is `info`. Other options include: `trace`, `debug`, `info`, `warning`, `error` and `fatal`. The value `debug` is useful for troubleshooting: you will be able to see how NGINX Ingress Controller gets updates from the Kubernetes API, generates NGINX configuration and reloads NGINX.
-See also the doc about Ingress Controller [command-line arguments](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments).
+See also the doc about NGINX Ingress Controller [command-line arguments](/nginx-ingress-controller/configuration/global-configuration/command-line-arguments).
## NGINX Logs
diff --git a/tests/data/virtual-server-certmanager/certmanager.yaml b/tests/data/virtual-server-certmanager/certmanager.yaml
index e11ba878b2..691d71d4b3 100644
--- a/tests/data/virtual-server-certmanager/certmanager.yaml
+++ b/tests/data/virtual-server-certmanager/certmanager.yaml
@@ -5186,7 +5186,7 @@ spec:
image: "quay.io/jetstack/cert-manager-cainjector:v1.9.1"
imagePullPolicy: IfNotPresent
args:
- - --v=2
+ - --log-level=debug
- --leader-election-namespace=kube-system
env:
- name: POD_NAMESPACE
@@ -5238,7 +5238,7 @@ spec:
image: "quay.io/jetstack/cert-manager-controller:v1.9.1"
imagePullPolicy: IfNotPresent
args:
- - --v=2
+ - --log-level=debug
- --cluster-resource-namespace=$(POD_NAMESPACE)
- --leader-election-namespace=kube-system
ports:
@@ -5291,7 +5291,7 @@ spec:
image: "quay.io/jetstack/cert-manager-webhook:v1.9.1"
imagePullPolicy: IfNotPresent
args:
- - --v=2
+ - --log-level=debug
- --secure-port=10250
- --dynamic-serving-ca-secret-namespace=$(POD_NAMESPACE)
- --dynamic-serving-ca-secret-name=cert-manager-webhook-ca
diff --git a/tests/suite/test_app_protect_watch_namespace_label.py b/tests/suite/test_app_protect_watch_namespace_label.py
index 44ed58723e..8aedce9cfc 100644
--- a/tests/suite/test_app_protect_watch_namespace_label.py
+++ b/tests/suite/test_app_protect_watch_namespace_label.py
@@ -134,7 +134,7 @@ def fin():
f"-enable-app-protect",
f"-enable-prometheus-metrics",
f"-watch-namespace-label=app=watch",
- f"-v=3",
+ f"-log-level=debug",
]
}
],
diff --git a/tests/suite/test_dos.py b/tests/suite/test_dos.py
index 7019aebff2..93f9d9b49c 100644
--- a/tests/suite/test_dos.py
+++ b/tests/suite/test_dos.py
@@ -152,7 +152,7 @@ def fin():
"extra_args": [
f"-enable-custom-resources",
f"-enable-app-protect-dos",
- f"-v=3",
+ f"-log-level=debug",
f"-app-protect-dos-debug",
]
}
diff --git a/tests/suite/test_filter_secrets.py b/tests/suite/test_filter_secrets.py
index fbd775021a..abcb121eb7 100644
--- a/tests/suite/test_filter_secrets.py
+++ b/tests/suite/test_filter_secrets.py
@@ -32,7 +32,7 @@ def fin():
@pytest.mark.ingresses
@pytest.mark.parametrize(
"ingress_controller",
- [pytest.param({"extra_args": ["-v=3"]})],
+ [pytest.param({"extra_args": ["-log-level=debug"]})],
indirect=["ingress_controller"],
)
class TestFilterSecret:
@@ -45,7 +45,7 @@ def test_filter_secret_single_namespace(self, request, kube_apis, ingress_contro
@pytest.mark.ingresses
@pytest.mark.parametrize(
"ingress_controller",
- [pytest.param({"extra_args": ["-v=3"]})],
+ [pytest.param({"extra_args": ["-log-level=debug"]})],
indirect=["ingress_controller"],
)
class TestFilterAfterIcCreated:
@@ -99,7 +99,7 @@ def fin():
@pytest.mark.ingresses
@pytest.mark.parametrize(
"ingress_controller",
- [pytest.param({"extra_args": ["-v=3", "-watch-namespace=filtered-ns-1,filtered-ns-2"]})],
+ [pytest.param({"extra_args": ["-log-level=debug", "-watch-namespace=filtered-ns-1,filtered-ns-2"]})],
indirect=["ingress_controller"],
)
class TestFilterSecretMultipuleNamespace:
@@ -114,7 +114,7 @@ def test_filter_secret_multi_namespace(
@pytest.mark.ingresses
@pytest.mark.parametrize(
"ingress_controller",
- [pytest.param({"extra_args": ["-v=3", "-watch-namespace=filtered-ns-1,filtered-ns-2"]})],
+ [pytest.param({"extra_args": ["-log-level=debug", "-watch-namespace=filtered-ns-1,filtered-ns-2"]})],
indirect=["ingress_controller"],
)
class TestFilterSecretMultipleNamespaceAfterIcCreated:
diff --git a/tests/suite/test_transport_server_backup_service.py b/tests/suite/test_transport_server_backup_service.py
index e2b9ae925d..cde078824c 100644
--- a/tests/suite/test_transport_server_backup_service.py
+++ b/tests/suite/test_transport_server_backup_service.py
@@ -169,7 +169,7 @@ def fin():
"type": "complete",
"extra_args": [
"-enable-tls-passthrough=true",
- "-v=3",
+ "-log-level=debug",
],
},
{"example": "transport-server-backup-service", "tls_passthrough_port": 443},
diff --git a/tests/suite/test_transport_server_tcp_load_balance.py b/tests/suite/test_transport_server_tcp_load_balance.py
index bd812b8902..b0c007c74d 100644
--- a/tests/suite/test_transport_server_tcp_load_balance.py
+++ b/tests/suite/test_transport_server_tcp_load_balance.py
@@ -651,7 +651,7 @@ def test_secure_tcp_request_load_balanced(
"-global-configuration=nginx-ingress/nginx-configuration",
"-enable-leader-election=false",
"-enable-prometheus-metrics",
- "-v=3",
+ "-log-level=debug",
],
},
{"example": "transport-server-tcp-load-balance"},
diff --git a/tests/suite/test_v_s_route_weight_changes_dynamic_reload_many_splits.py b/tests/suite/test_v_s_route_weight_changes_dynamic_reload_many_splits.py
index 3aaf094838..6310eb35e4 100644
--- a/tests/suite/test_v_s_route_weight_changes_dynamic_reload_many_splits.py
+++ b/tests/suite/test_v_s_route_weight_changes_dynamic_reload_many_splits.py
@@ -127,7 +127,7 @@ def fin():
"-enable-custom-resources",
"-enable-prometheus-metrics",
"-weight-changes-dynamic-reload=true",
- "-v=3",
+ "-log-level=debug",
],
},
{"example": "virtual-server-route-weight-changes-dynamic-reload"},
diff --git a/tests/suite/test_virtual_server_backup_service.py b/tests/suite/test_virtual_server_backup_service.py
index e081491e0d..e48d041e98 100644
--- a/tests/suite/test_virtual_server_backup_service.py
+++ b/tests/suite/test_virtual_server_backup_service.py
@@ -116,7 +116,7 @@ def fin():
"type": "complete",
"extra_args": [
f"-enable-custom-resources",
- f"-v=3",
+ f"-log-level=debug",
],
},
{
diff --git a/tests/suite/test_virtual_server_dos.py b/tests/suite/test_virtual_server_dos.py
index 92caf0387c..2f1a3263ea 100644
--- a/tests/suite/test_virtual_server_dos.py
+++ b/tests/suite/test_virtual_server_dos.py
@@ -163,7 +163,7 @@ def fin():
"extra_args": [
f"-enable-custom-resources",
f"-enable-app-protect-dos",
- f"-v=3",
+ f"-log-level=debug",
],
},
{"example": "virtual-server-dos", "app_type": "dos"},
diff --git a/tests/suite/test_virtual_server_external_name.py b/tests/suite/test_virtual_server_external_name.py
index 89695247cc..0dc5038730 100644
--- a/tests/suite/test_virtual_server_external_name.py
+++ b/tests/suite/test_virtual_server_external_name.py
@@ -91,7 +91,7 @@ def fin():
"crd_ingress_controller, virtual_server_setup",
[
(
- {"type": "complete", "extra_args": [f"-enable-custom-resources", "-v=3"]},
+ {"type": "complete", "extra_args": [f"-enable-custom-resources", "-log-level=debug"]},
{"example": "virtual-server-externalname", "app_type": "simple"},
)
],