function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
loneboatloneboat 

Logging Levels in Developer Console having no effect...

I'm trying to pick through some debug logs.  I would REALLY LIKE to be able to filter the verbosity of the logs.  I tried changing the settings for everything to "Error", but I'm still seeing a lot of junk in the logs (e.g. validation rules).  See screenshot.

 

 

Why am I seeing everything, despite having set the logging levels to Error?

 

Note that I'm seeing this behavior in both the Developer Console in my browser AND in the Force.com IDE Apex Test Runner pane.

Best Answer chosen by Admin (Salesforce Developers) 
loneboatloneboat

Well, I played around with this all morning, and couldn't get what I wanted.  I finally changed tack and wrote a script which, when you press Ctrl-Alt-d, filters out all lines which contain the text "USER_DEBUG", writes them to a text file, and then opens that text file.  So now I can run my test in the IDE, press Ctrl-Alt-d, and then see ONLY my own debug lines.

 

Kind of a hack, but it works.  :-)  Code is below if anyone else wants to try it out:

 

^!d::
    file_name_temp     = force.com_ide_log_helper_temp.dat
    file_name_filtered = force.com_ide_log_helper_filtered.dat
    
    ; read the debug text into a temp file
    WinGetText, editControlText, ahk_class #32770
    FileAppend, %editControlText%, %file_name_temp%
    
    
    ; delete the permanent file (if it exists)
    FileDelete, %file_name_filtered%
    
    ; step through the temp file, saving all USER_DEBUG lines to a permanent file
    Loop, read, %file_name_temp%, %file_name_filtered%
    {
        IfInString, A_LoopReadLine, USER_DEBUG, FileAppend, %A_LoopReadLine%`n
    }
    
    ; open the filtered file
    Run, %file_name_filtered%
    
    ; delete the temp file
    FileDelete, %file_name_temp%

    return

 

 

You'll need to install the [open-source] scripting tool "Autohotkey" for this to work, and save the above script with an ".ahk" extension.

All Answers

loneboatloneboat

Well, I played around with this all morning, and couldn't get what I wanted.  I finally changed tack and wrote a script which, when you press Ctrl-Alt-d, filters out all lines which contain the text "USER_DEBUG", writes them to a text file, and then opens that text file.  So now I can run my test in the IDE, press Ctrl-Alt-d, and then see ONLY my own debug lines.

 

Kind of a hack, but it works.  :-)  Code is below if anyone else wants to try it out:

 

^!d::
    file_name_temp     = force.com_ide_log_helper_temp.dat
    file_name_filtered = force.com_ide_log_helper_filtered.dat
    
    ; read the debug text into a temp file
    WinGetText, editControlText, ahk_class #32770
    FileAppend, %editControlText%, %file_name_temp%
    
    
    ; delete the permanent file (if it exists)
    FileDelete, %file_name_filtered%
    
    ; step through the temp file, saving all USER_DEBUG lines to a permanent file
    Loop, read, %file_name_temp%, %file_name_filtered%
    {
        IfInString, A_LoopReadLine, USER_DEBUG, FileAppend, %A_LoopReadLine%`n
    }
    
    ; open the filtered file
    Run, %file_name_filtered%
    
    ; delete the temp file
    FileDelete, %file_name_temp%

    return

 

 

You'll need to install the [open-source] scripting tool "Autohotkey" for this to work, and save the above script with an ".ahk" extension.

This was selected as the best answer
YogeshAroraYogeshArora

Hello,

 

I am also experiencing the same problem. The code you have provided is surely a solution for it.

But debug log filters are not working the way they are supposed to work. Is it a bug in debug log filters ? Or, are we unable to make it work properly ?

SScholtzSScholtz

Yogesh, you might find this useful: http://stackoverflow.com/questions/11635043/salesforce-debug-log-filters-stuck-and-will-not-change

 

I was having the same problem, but the problem was that I was trying to debug some test methods, and test methods run with a pre-defined set of log levels that you can't alter. (Vote to have this fixed! http://success.salesforce.com/ideaView?id=08730000000iKMpAAM)