tencent cloud

Feedback

Context Search and Analysis

Last updated: 2024-01-20 17:25:15
    This document describes how to view the context of a log in the original file in the CLS console.

    Overview

    Log context search refers to searching for the log’s context, that is, several logs before or after the log itself. This feature allows you to troubleshoot quickly whenever an error occurs.

    Advantages

    Log context search frees you from the hassles associated with machine logins. On the log search page, you can quickly view the log context of any file/machine.
    Knowing the actual error occurrence time, you can specify a time range on the log search page to quickly locate the suspicious log and query its context for troubleshooting.
    Storage capacity of the server or data loss caused by log rotation will not be a problem. The data history can be viewed on the log search page anytime.

    Prerequisites

    Log context search and analysis are available only for version 2.3.5 and above. You are advised to install or upgrade to the latest version.
    Context search is supported for only logs collected by LogListener.
    You have enabled and configured index. For more information, please see Configuring Index.

    Example

    The common process of an order is as follows: log in > browse merchandise > select merchandise> add merchandise to the shopping cart > place an order > pay for the order > make a deduction > generate the order. Use case: if one of the orders of a user fails, you can query the error log using the order number. Then, locate the log’s context to find out the cause (for example, order deduction failed). You can troubleshoot in CLS as follows:
    1. Log in to the CLS console and go to the Search and Analysis page. Then, specify a time range based on the error occurrence time and enter the keyword (order number) to locate the error log of the order.
    2. Scroll up/down based on the error log until you locate the desired context of the log.
    
    
    

    Directions

    1. Log in to the CLS console.
    2. On the left sidebar, click Log Search to go to the Search and Analysis page.
    3. Select the Region, Logset, and Log Topic as needed.
    4. On the Raw Data tab, find the time of the error log and click
    
    to go to the context search and analysis page.
    5. On the context search and analysis page, 10 logs before and after the error log will be displayed.
    On this page, you can:
    Scroll up/down to view the context.
    Click Show Earlier to page up. Up to 20 previous logs can be displayed at a time.
    Click Show More to page down. Up to 20 later logs can be displayed at a time.
    Enter the keyword in the Highlight text box to fill the keyword in yellow.
    Enter a string in the Filter Logs text box to highlight the string.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support