Here's a slightly shorter/simpler version of my previous answer. To keep things easy, we'll just make an AJAX call on every log, and to keep things even easier we'll use jQuery to do the "heavy lifting". (If you use a JS library other than jQuery, it should have some sort of similar method; if not, or if you're not using a JS library ... time to seriously consider jQuery!) Oh, and we'll throw in some server-side pseudo-code to demonstrate just how easy that part of the equation is.
Step 1: Add a bunch of console.log statements that will help diagnose your issue
Step 2: Add logic to re-define console.log on your client's system so that it sends the log to your server if there is no console
var SERVER_URL = "www.yourServer.com/ajaxLogger.jsp";
var ajaxConsole = {"log":function(x) {
$.get(SERVER_URL, {"log":x});
}}
console = console || ajaxConsole; // If there is no console, use the AJAX one
Step 3: Create a logging page on your server
The following example uses pseudo-code, since everyone has a different server-side language:
String log = pageParameters["log"];
Database.execute("INSERT INTO yourLogTable (log, date) VALUES ('" +
dbEscape(log) +"', current date)");