---
schema_version: "1"
id: f609651908c21ac7c31f29bc91ffc737596a139e5ea29d14e53c19f00e3a5399
title: Searching a Debug Log
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/code_dev_console_search_debug_log.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.code_dev_console_search_debug_log.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d7f9c15d5c99a5c8fac53018d826e62f9a196c165b74f561ea5bd341c5b2f8cf
description: To search for text in a debug log, use the Command Line Window in the Developer Console.
products:
  - Salesforce Platform
release: "264"
---
# Searching a Debug Log

To search for text in a debug log, use the Command Line Window in the Developer Console.

Before you can search, you must execute Apex statements to generate the log from the Command Line Window.

1. To open the Command Line Window, click CTRL+L.
2. Execute Apex code to generate a log:
    - To enter Apex statements at the command-line, type exec <Apex statements>.
        
        For example:
        
        ```
        exec List<Account> accts = new List<Account>();
        for (Integer i=0; i<20; i++){
        	Account a = new Account(name='Account Name ' + i);
        	accts.add(a);
        }
        ```
    - To execute code you already entered in the Enter Apex Code window, type exec-r.
3. After the log has been generated, type find <string> to search for the specified text.
    
    For example: `find Account Name`.
    
    Search results are displayed in the Command Line Window.
4. To close the Command Line Window, click CTRL+L.

#### See Also

- [Developer Console Command Line Reference](https://help.salesforce.com/s/articleView?id=platform.code_dev_console_command_line.htm&release=264.0.0&type=5 "The Developer Console includes a command line for various useful commands.")