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
Ken KoellnerKen Koellner 

Developer Console, anyway way to get log as plain-old vanilla web page text?

Developer Console shows the Apex log.  But it reads it in via script and it isn't really part of the page.  The filter works but most of the time I do not want to file.  I just want to search for somethings and then scroll up and down.

 

Is there a way from the Dev Console to just the the log as a plain text web page, like in another web browser window?

 

Most of the time, I use Dev Console just to launch annonymous Apex and I have Debug Monitoring on in a browser window so I can get the log as an actual web page.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Thomas DvornikThomas Dvornik

Unfortunately not. You can select the log and do File -> Open as Raw Log and do a browser search.

 

 

However, you could use something like a bookmarklet. I created one for you if this makes it easier.

 

1) Allow popups from salesforce. If in chrome, go to Settings -> Privacy -> Content settings... -> Pop-ups -> Manage Exceptions. Add the following: https://[*.]salesforce.com  (you can also add your instance in there if you want).

 

2) Create a new bookmarklet. In chrome, open the Bookmark manager, under bookmark bar, right click and select "New Page...". Enter a title of "OpenLogInNewTab" (or whatever you want) and the following javascript as the url. Note you need the "javascript" part.

 

javascript&colon;var l = Ext.getCmp('traceGrid'); var s = l.selModel.selected; if (s && s.length===1) { var id = s.items[0].data.Id; SfdcDevConsole.ToolingAPI.sobject('ApexLog', {id : id, body : true, success:function(r){var w = window.open('', id);w.document.write(r.replace(/\n/g,'<br/>'));w.focus();}}) }

 Edit: Note that the &colon; should be an actual ':'. The boards are encoding it.

 

3) Open the dev console as a new tab. https://<your instance>.salesforce.com/_ui/common/apex/debug/ApexCSIPage

 

4) Execute a log, select it, and click on the bookmark. It will open the log in a new tab as raw html. Notice in the javascript that I replaced all new lines with "<br/> so you can see the lines. You can remove that if you want, but then it will look like a blob of text.

 

Hope that helps,

 

Thomas

All Answers

Thomas DvornikThomas Dvornik

Unfortunately not. You can select the log and do File -> Open as Raw Log and do a browser search.

 

 

However, you could use something like a bookmarklet. I created one for you if this makes it easier.

 

1) Allow popups from salesforce. If in chrome, go to Settings -> Privacy -> Content settings... -> Pop-ups -> Manage Exceptions. Add the following: https://[*.]salesforce.com  (you can also add your instance in there if you want).

 

2) Create a new bookmarklet. In chrome, open the Bookmark manager, under bookmark bar, right click and select "New Page...". Enter a title of "OpenLogInNewTab" (or whatever you want) and the following javascript as the url. Note you need the "javascript" part.

 

javascript&colon;var l = Ext.getCmp('traceGrid'); var s = l.selModel.selected; if (s && s.length===1) { var id = s.items[0].data.Id; SfdcDevConsole.ToolingAPI.sobject('ApexLog', {id : id, body : true, success:function(r){var w = window.open('', id);w.document.write(r.replace(/\n/g,'<br/>'));w.focus();}}) }

 Edit: Note that the &colon; should be an actual ':'. The boards are encoding it.

 

3) Open the dev console as a new tab. https://<your instance>.salesforce.com/_ui/common/apex/debug/ApexCSIPage

 

4) Execute a log, select it, and click on the bookmark. It will open the log in a new tab as raw html. Notice in the javascript that I replaced all new lines with "<br/> so you can see the lines. You can remove that if you want, but then it will look like a blob of text.

 

Hope that helps,

 

Thomas

This was selected as the best answer
Ken KoellnerKen Koellner

Thomas,

 

Nice workaround.  It's similiar to a script that someone wrote last year for the DF '12 web side to download events since it didn't have an export to calendar last year.

 

I found the easiest thing to do was to put the following text in a file, .e.g, temp.html.  Then open the file in my browser (I use mostly FF although I admit that Chrome is superior; I'm just used to FF.), right-click on the link and then do Create Bookmark.

 

<a href="javascript&colon;var l = Ext.getCmp('traceGrid'); var s = l.selModel.selected; if (s && s.length===1) { var id = s.items[0].data.Id; SfdcDevConsole.ToolingAPI.sobject('ApexLog', {id : id, body : true, success:function(r){var w = window.open('', id);w.document.write(r.replace(/\n/g,'<br/>'));w.focus();}}) }">Open Debug Log</a>

 

 

The trick of course is to open the dev console manually via a URL  like -- https://cs16.salesforce.com/_ui/common/apex/debug/ApexCSIPage so you have access to your book marks.