Storing the API log locally When an apiscript crashes, the message that is visible in the campaign api hardly ever proves useful to find the error. Especially when you open this page after the fact. I hate losing logs and so on the homeserver a VM is running with firefox open on the campaign script pages of selected games. In the developer console of the browerser execute the following snippet to download each API log line in a seperate file. Firebase.enableLogging(function(message) { let millis = Date.now() let prefix = "p:0: handleServerMessage d "; if( message.startsWith(prefix) ) { let eventStr = message.substring(prefix.length) let campaign = eventStr.split("-")[1]; if( campaign === 'notifiers/campaign') { campaign = eventStr.split("-")[2]; } let time = 0 if(eventStr.split('"time":').length > 1) { time = eventStr.split('"time":')[1].split(/,}/)[0] } console.log("[FIREBASE]", eventStr); let filename = "apilog-"+campaign+"-"+millis+"-"+time+".json"; var blob = new Blob([eventStr], {type: 'text/csv'}); var e = document.createEvent('MouseEvents'); var a = document.createElement('a'); a.download = filename; a.href = window.URL.createObjectURL(blob); a.dataset.downloadurl = ['text/csv', a.download, a.href].join(':'); e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); a.dispatchEvent(e); } }); As this approach creates a file for each message, an hourly crontab moves the downloaded json files into a zip zip -m apilog.zip apilog-*.json Above snippet includes two timestamps in the filename of each log event: the time of your computer and the server time. The fluctuation of the difference between these two timestamps gives (under certain condictions) an indication of the API server lag. Which by the way is good - as the analysis of a few 100k logged events shows. On a side note: i dare say that using firebase to roll dice would be much less laggy than the current diceroll via Cloudflare.