Skip to content

Commit 1868839

Browse files
DEV: Stop logging theme load errors to logster (#36222)
In our experience, this is creating a significant amount of un-actionable noise in the logs. Themes can fail to boot for all sorts of client-caused reasons, like a poor network connection, adblocker, unsupported browser, etc. Logging those to Logster is not helpful, and only leads to confusion for admins and hosting providers.
1 parent e5fb8b5 commit 1868839

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

config/discourse_defaults.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ maxmind_mirror_url =
324324
enable_performance_http_headers = false
325325

326326
# gather JavaScript errors from clients (rate limited to 1 error per IP per minute)
327-
enable_js_error_reporting = true
327+
enable_js_error_reporting = false
328328

329329
# This is probably not a number you want to touch, it controls the number of workers
330330
# we allow mini scheduler to run. Prior to 2019 we ran a single worker.

frontend/discourse/app/services/client-error-handler.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { getOwner } from "@ember/owner";
22
import Service, { service } from "@ember/service";
3-
import $ from "jquery";
43
import { getAndClearUnhandledThemeErrors } from "discourse/app";
54
import { bind } from "discourse/lib/decorators";
65
import escape from "discourse/lib/escape";
7-
import getURL from "discourse/lib/get-url";
86
import { disableImplicitInjections } from "discourse/lib/implicit-injections";
97
import identifySource, {
108
consolePrefix,
@@ -56,7 +54,6 @@ export default class ClientErrorHandlerService extends Service {
5654
};
5755

5856
reportToConsole(error, source);
59-
reportToLogster(source.name, error);
6057

6158
const message = i18n("themes.broken_theme_alert");
6259
this.displayErrorNotice(message, source);
@@ -105,19 +102,6 @@ export default class ClientErrorHandlerService extends Service {
105102
}
106103
}
107104

108-
function reportToLogster(name, error) {
109-
const data = {
110-
message: `${name} theme/component is throwing errors:\n${error.name}: ${error.message}`,
111-
stacktrace: error.stack,
112-
};
113-
114-
// TODO: To be moved out into a logster-provided lib
115-
$.ajax(getURL("/logs/report_js_error"), {
116-
data,
117-
type: "POST",
118-
});
119-
}
120-
121105
function reportToConsole(error, source) {
122106
const prefix = consolePrefix(error, source);
123107
if (prefix) {

0 commit comments

Comments
 (0)