Archived copy of A Swedish wolf in Norway

Miscellaneous technobabble from a Swede in Norway.

Logging errors to file in Opera 9

Published: 2005-10-20 21:10:04

[http://my.opera.com/nafmo/homes/blog/operaerrorlog-400.png] In Opera 8, there was support for logging JavaScript messages to file. In Opera 9, taking advantage of the new general message console, error logging has been expanded so that you can log any message that is shown in the console to file.

To enable console logging, you will need to configure it directly through the preferences file (opera6.ini). You can do this by opening opera:config and entering error log in the Quick find field. You will see three options, all in the User Prefs section:

Console Error Log
This is the file name for the error log. Enter the full path to where you want the error log to be created. This defaults to error.log in your profile directory (known as "Opera directory" on the opera:about page).
Console Error Log Enabled
Set this to 1 (tick the box) to enable logging.
Console Error Log Filter
This is where you select what to log. By default, only JavaScript messages are set up to be logged. You can add other sources as a comma separated list (for instance javascript,mail). For a list of the message sources that are available, play around with the console (open with ToolsAdvancedJavaScript console, and yes, we do plan to rename that) and check the filter setting stored to Console Filter (press the Reset button to update the settings in the opera:config document if you have it open while changing the setting in the console).

Once you've configured these, press OK in the document and logging should be active. To test it, you can post messages to the console yourself by writing
javascript:opera.postError("your message here")
in the address field or Go to page dialogue (F2).

Have fun!

Tags: opera browsers

peter@softwolves.pp.se

This was originally posted on My Opera at http://my.opera.com/nafmo/blog/show.dml/47706
Please note that links may be outdated and any information included here may be obsolete.

← Tweaking preferences in Opera 9 | Changes in the ini file for Opera 9 → | Back to the post index | Back to the archive index | Peter's homepage