|
|
@@ -162,7 +162,10 @@ const APP = {
|
|
162
|
162
|
initLogging () {
|
|
163
|
163
|
// Adjust logging level
|
|
164
|
164
|
configureLoggingLevels();
|
|
165
|
|
- // Start the LogCollector and register it as the global log transport
|
|
|
165
|
+ // Create the LogCollector and register it as the global log transport.
|
|
|
166
|
+ // It is done early to capture as much logs as possible. Captured logs
|
|
|
167
|
+ // will be cached, before the JitsiMeetLogStorage gets ready (statistics
|
|
|
168
|
+ // module is initialized).
|
|
166
|
169
|
if (!this.logCollector && !loggingConfig.disableLogCollector) {
|
|
167
|
170
|
this.logCollector = new LogCollector(new JitsiMeetLogStorage());
|
|
168
|
171
|
Logger.addGlobalTransport(this.logCollector);
|
|
|
@@ -189,19 +192,29 @@ function init() {
|
|
189
|
192
|
APP.ConferenceUrl = new ConferenceUrl(window.location);
|
|
190
|
193
|
// Clean up the URL displayed by the browser
|
|
191
|
194
|
replaceHistoryState(APP.ConferenceUrl.getInviteUrl());
|
|
192
|
|
- var isUIReady = APP.UI.start();
|
|
|
195
|
+ const isUIReady = APP.UI.start();
|
|
193
|
196
|
if (isUIReady) {
|
|
194
|
|
- // Start the LogCollector's periodic "store logs" task only if we're in
|
|
195
|
|
- // the conference and not on the welcome page.
|
|
196
|
|
- if (APP.logCollector) {
|
|
197
|
|
- APP.logCollector.start();
|
|
198
|
|
- APP.logCollectorStarted = true;
|
|
199
|
|
- }
|
|
200
|
|
-
|
|
201
|
197
|
APP.conference.init({roomName: buildRoomName()}).then(function () {
|
|
202
|
198
|
|
|
203
|
|
- // Will flush the logs, before the stats are disposed
|
|
204
|
199
|
if (APP.logCollector) {
|
|
|
200
|
+ // Start the LogCollector's periodic "store logs" task only if
|
|
|
201
|
+ // we're in the conference and not on the welcome page. This is
|
|
|
202
|
+ // determined by the value of "isUIReady" const above.
|
|
|
203
|
+ APP.logCollector.start();
|
|
|
204
|
+ APP.logCollectorStarted = true;
|
|
|
205
|
+ // Make an attempt to flush in case a lot of logs have been
|
|
|
206
|
+ // cached, before the collector was started.
|
|
|
207
|
+ APP.logCollector.flush();
|
|
|
208
|
+
|
|
|
209
|
+ // This event listener will flush the logs, before
|
|
|
210
|
+ // the statistics module (CallStats) is stopped.
|
|
|
211
|
+ //
|
|
|
212
|
+ // NOTE The LogCollector is not stopped, because this event can
|
|
|
213
|
+ // be triggered multiple times during single conference
|
|
|
214
|
+ // (whenever statistics module is stopped). That includes
|
|
|
215
|
+ // the case when Jicofo terminates the single person left in the
|
|
|
216
|
+ // room. It will then restart the media session when someone
|
|
|
217
|
+ // eventually join the room which will start the stats again.
|
|
205
|
218
|
APP.conference.addConferenceListener(
|
|
206
|
219
|
ConferenceEvents.BEFORE_STATISTICS_DISPOSED,
|
|
207
|
220
|
() => {
|