Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Container Engine/ User Guide/ O&M/ Logging/ Collecting NGINX Ingress Controller Logs

Collecting NGINX Ingress Controller Logs

Updated on 2025-01-07 GMT+08:00

The Cloud Native Log Collection add-on can collect the logs of the NGINX Ingress Controller add-on. You can use the logs to analyze traffic changes and obtain service traffic characteristics for service decision making.

Constraints

Billing

LTS does not charge you for creating log groups and offers a free quota for log collection every month. You pay only for log volume that exceeds the quota. For details, see Price Calculator.

Step 1: Enabling Log Collection

The NGINX Ingress Controller add-on has been installed in the cluster, with log collection enabled.

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Add-ons.
  2. Find the NGINX Ingress Controller add-on and enable Logging.
    • If the add-on has been installed, click Manage, locate the installed add-on instance, and click Edit. Then, enable Logging.

      If multiple add-on instances are installed in the cluster, you need to modify the configuration of each add-on instance to collect logs of all instances.

    • If the add-on is not installed, click Install. Then, enable Logging. Set other parameters as required. For details, see NGINX Ingress Controller.

Step 2: Collecting NGINX Ingress Controller Logs in Logging

To enable log collection for the NGINX Ingress Controller add-on in different scenarios, take the following steps.

If logging is not enabled for a cluster, you can select Collect add-on logs (NGINX Ingress Controller stdout logs) when enabling logging to create the default log collection policy for the NGINX Ingress Controller add-on.

  1. On the CCE console, click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. If you are not authorized, obtain required permissions first. Otherwise, skip this step.

    In the displayed dialog box, click Authorize.

    Figure 1 Adding authorization

  3. On the page that is displayed, select the type of logs to be collected and click Enable. Wait for about 30 seconds. The new page is automatically displayed.
    Figure 2 Enabling log collection
    • Stdout logs: You can enable this option as needed. After it is enabled, a log collection policy named default-stdout will be created, which will report stdout logs from all namespaces to LTS.
    • Kubernetes events: You can enable this option as needed. After it is enabled, a log collection policy named default-event will be created, which will report Kubernetes events from all namespaces to LTS.
    • NGINX Ingress Controller stdout logs: This option is mandatory. You need to install the NGINX Ingress Controller add-on and enable logging for it.

      After logging is enabled, a log policy named default-nginx-ingress will be created to collect stdout logs of NGINX Ingress Controller and report the logs to LTS.

If logging has been enabled for a cluster but log collection is not enabled for the NGINX Ingress Controller add-on, you can manually create a log collection policy.

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. In the upper right corner, click View Log Collection Policies. All log collection policies in the current cluster are displayed.
  3. Click Create Log Collection Policy. Then, select Collect NGINX Ingress Controller stdout Logs and click OK.
    Figure 3 Creating a log collection policy
  4. (The system automatically creates a log collection policy named default-nginx-ingress.) Go to the Logging page and click the Add-on Logs tab to view the logs reported by the add-on to LTS.
    Figure 4 Viewing logs

If logging is not enabled for a cluster, you can select Collect add-on logs (NGINX Ingress Controller stdout logs) when enabling logging to create the default log collection policy for the NGINX Ingress Controller add-on.

  1. On the CCE console, click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. If you are not authorized, obtain required permissions first. Otherwise, skip this step.

    In the displayed dialog box, click Authorize.

    Figure 1 Adding authorization

  3. On the page that is displayed, select the type of logs to be collected and click Enable. Wait for about 30 seconds. The new page is automatically displayed.
    Figure 2 Enabling log collection
    • Stdout logs: You can enable this option as needed. After it is enabled, a log collection policy named default-stdout will be created, which will report stdout logs from all namespaces to LTS.
    • Kubernetes events: You can enable this option as needed. After it is enabled, a log collection policy named default-event will be created, which will report Kubernetes events from all namespaces to LTS.
    • NGINX Ingress Controller stdout logs: This option is mandatory. You need to install the NGINX Ingress Controller add-on and enable logging for it.

      After logging is enabled, a log policy named default-nginx-ingress will be created to collect stdout logs of NGINX Ingress Controller and report the logs to LTS.

If logging has been enabled for a cluster but log collection is not enabled for the NGINX Ingress Controller add-on, you can manually create a log collection policy.

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. In the upper right corner, click View Log Collection Policies. All log collection policies in the current cluster are displayed.
  3. Click Create Log Collection Policy. Then, select Collect NGINX Ingress Controller stdout Logs and click OK.
    Figure 3 Creating a log collection policy
  4. (The system automatically creates a log collection policy named default-nginx-ingress.) Go to the Logging page and click the Add-on Logs tab to view the logs reported by the add-on to LTS.
    Figure 4 Viewing logs

Step 3: Viewing NGINX Ingress Controller Logs

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click the Add-ons Log tab and select the NGINX Ingress Controller add-on. For details about related operations, see LTS User Guide.
    Figure 5 Viewing NGINX Ingress Controller logs

  3. (If multiple add-on instances are installed in the cluster and log collection has been enabled for these instances, logs of all instances will be displayed.) Search for logs by appName.
    The options of appName are as follows:
    • If the NGINX Ingress Controller name is nginx, the value of appName is cceaddon-nginx-ingress-controller.
    • If the NGINX Ingress Controller name is user-defined, for example, {className}, the value of appName is cceaddon-nginx-ingress-{className}-controller.

    The following are example logs of cceaddon-nginx-ingress-controller:

    appName : cceaddon-nginx-ingress-controller

Step 4: Viewing Dashboards of NGINX Ingress

CCE can collect the logs of NGINX Ingress and work with LTS for multi-dimensional analysis. It also provides structured logging and three types of dashboards (monitoring center, access center, and second-by-second monitoring) to meet monitoring requirements in different scenarios.

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click the Add-on Logs tab and then the Dashboard tab. On the displayed tab, you can select different dashboard templates.
  3. (If multiple add-on instances are installed in the cluster and log collection has been enabled for these instances, logs of all instances will be displayed.) Search for logs by appName.
    The options of appName are as follows:
    • If the NGINX Ingress Controller name is nginx, the value of appName is cceaddon-nginx-ingress-controller.
    • If the NGINX Ingress Controller name is user-defined, for example, {className}, the value of appName is cceaddon-nginx-ingress-{className}-controller.

This dashboard displays basic information about NGINX Ingress in different time dimensions (relative time from now, relative time from last, and specified time), including:

  • Access data: PV, UV, request success rate, average latency, the number of 4XX requests, the number of 404 requests, the number of 429 requests, the number of 5XX requests, the number of 504 requests, status code distribution, traffic, access failure rate, and latency
  • Top statistics: hosts ranked by requests, hosts ranked by latencies, hosts ranked by failure rates, URLs ranked by requests, URLs ranked by latencies, URLs ranked by failure rates, backend severs ranked by requests, backend severs ranked by latencies, and backend severs ranked by failure rates

This dashboard displays access request statistics in different time dimensions (relative time from now, relative time from last, and specified time), including:

  • Data comparison: day-over-day PV, week-over-week PV, day-over-day UV, week-over-week UV, PV/UV today, and PV/UV in past seven days
  • Data distribution: PV distribution (China), PV distribution (global), UV distribution (China), UV distribution (global), average latency distribution (China), average latency distribution (global), device proportion (by terminal), and device proportion (by system)
  • Top statistics: top 10 provinces with the most requests, top 10 cities with the most requests, top 10 hosts with the most requests, top 10 UserAgents with the most requests, top URLs with the most requests, and top IP addresses with the most requests

This dashboard displays NGINX Ingress traffic and application performance in real time, including QPS, success rates, latencies, traffic, status codes, and backend response codes.

This dashboard displays basic information about NGINX Ingress in different time dimensions (relative time from now, relative time from last, and specified time), including:

  • Access data: PV, UV, request success rate, average latency, the number of 4XX requests, the number of 404 requests, the number of 429 requests, the number of 5XX requests, the number of 504 requests, status code distribution, traffic, access failure rate, and latency
  • Top statistics: hosts ranked by requests, hosts ranked by latencies, hosts ranked by failure rates, URLs ranked by requests, URLs ranked by latencies, URLs ranked by failure rates, backend severs ranked by requests, backend severs ranked by latencies, and backend severs ranked by failure rates

This dashboard displays access request statistics in different time dimensions (relative time from now, relative time from last, and specified time), including:

  • Data comparison: day-over-day PV, week-over-week PV, day-over-day UV, week-over-week UV, PV/UV today, and PV/UV in past seven days
  • Data distribution: PV distribution (China), PV distribution (global), UV distribution (China), UV distribution (global), average latency distribution (China), average latency distribution (global), device proportion (by terminal), and device proportion (by system)
  • Top statistics: top 10 provinces with the most requests, top 10 cities with the most requests, top 10 hosts with the most requests, top 10 UserAgents with the most requests, top URLs with the most requests, and top IP addresses with the most requests

This dashboard displays NGINX Ingress traffic and application performance in real time, including QPS, success rates, latencies, traffic, status codes, and backend response codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback