Thursday, January 10, 2013

Searching a Debug Log:


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 a log, you must execute Apex statements to generate a log.
  1. To open the Developer Console Command Line Window, choose Your Name | Developer Console and press CTRL+L.
  2. To execute Apex code and generate a log, do one of the following:
    • To enter Apex statements at the command-line, type exec <Apex statements>.
      For example, type:
      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 that already exists in the Execute Apex Code window, type exec -r.
      1. To search for text in the debug log, type find <string>For example, type find Account Name. View the search results in the command-line window.
      2. To close the command-line, press CTRL+L.

No comments:

Post a Comment