- Published:July 17th, 2013
- Comments:No Comment
- Category:ConsoleExport, Documentation, Firebug, Firebug Extension, Planet Mozilla
There are many Firebug extensions implementing new nifty features for Firebug and its great to see that new ones are still coming.
In this post, we'll take a quick look at one of them: Console Export.
ConsoleExport is a Firebug extension (you need Firebug 1.6+) that allows exporting logs from the Console panel. The export can be done manually through an Export button (see the screenshot below) or automatically by sending every log to the server.
Here is the UI that appears in Firebug after ConsoleExport is installed in your Firefox.
A few links:
- ConsoleExport home page
- You can download ConsoleExport from here
- You can report an issue or suggest new feature here
Auto Export Every Console Log
Since most of the details about manual export is already available on the home page let's focus on auto-export where all logs are sent to the server as XML packets.
Step1: Activate auto-export
There are two ways how to activate/deactivate auto-export. You can use Firebug UI and click the little circle next to the Export button.
In case of automated scenarios (e.g. when Selenium is integrated) you can just set a preference (this is essentially what the button does).
extensions.firebug.consoleexport.active [boolean, default=false]
Step2: Handle XML packets on the server
Now you need to specify server URL where to send the logs (XML packets). This is done through another preference.
extensions.firebug.consoleexport.serverURL [string, default=""]
Here is an example server side script (PHP) that receives XML packets and stores them into consoleexport.log file.
$filename = 'consoleexport.log';
Here is an online page that generates some console logs (using console.* API)
And here is an example server side log:
<msg>ReferenceError: doesnotexist is not defined</msg>
You can also read detailed packet description.