Skip to content

Commit 8fa1cac

Browse files
juliajforestitassoevancoderabbitai[bot]
authored andcommitted
chore!: remove stdout logging functionality (#37114)
Co-authored-by: Tasso Evangelista <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 91e516a commit 8fa1cac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+31
-656
lines changed

.changeset/tough-baboons-wash.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@rocket.chat/rest-typings': major
3+
'@rocket.chat/ddp-client': major
4+
'@rocket.chat/logger': major
5+
'@rocket.chat/meteor': major
6+
---
7+
8+
Removes stdout logging functionality, related components and settings

apps/meteor/app/api/server/v1/misc.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { SystemLogger } from '../../../../server/lib/logger/system';
2323
import { browseChannelsMethod } from '../../../../server/methods/browseChannels';
2424
import { spotlightMethod } from '../../../../server/publications/spotlight';
2525
import { resetAuditedSettingByUser, updateAuditedByUser } from '../../../../server/settings/lib/auditedSettingUpdates';
26-
import { getLogs } from '../../../../server/stream/stdout';
2726
import { passwordPolicy } from '../../../lib/server';
2827
import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener';
2928
import { settings } from '../../../settings/server';
@@ -437,15 +436,6 @@ API.v1.addRoute(
437436
* schema:
438437
* $ref: '#/components/schemas/ApiFailureV1'
439438
*/
440-
API.v1.addRoute(
441-
'stdout.queue',
442-
{ authRequired: true, permissionsRequired: ['view-logs'] },
443-
{
444-
async get() {
445-
return API.v1.success({ queue: getLogs() });
446-
},
447-
},
448-
);
449439

450440
declare module '@rocket.chat/rest-typings' {
451441
// eslint-disable-next-line @typescript-eslint/naming-convention

apps/meteor/client/views/admin/routes.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ declare module '@rocket.chat/ui-contexts' {
6969
pattern: '/admin/invites';
7070
};
7171
'admin-view-logs': {
72-
pathname: '/admin/reports';
73-
pattern: '/admin/reports';
72+
pathname: '/admin/analytic-reports';
73+
pattern: '/admin/analytic-reports';
7474
};
7575
'admin-permissions': {
7676
pathname: `/admin/permissions${`/${string}` | ''}${`/${string}` | ''}`;
@@ -193,7 +193,7 @@ registerAdminRoute('/invites', {
193193
component: lazy(() => import('./invites/InvitesRoute')),
194194
});
195195

196-
registerAdminRoute('/reports', {
196+
registerAdminRoute('/analytic-reports', {
197197
name: 'admin-view-logs',
198198
component: lazy(() => import('./viewLogs/ViewLogsRoute')),
199199
});

apps/meteor/client/views/admin/sidebarItems.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export const {
108108
permissionGranted: (): boolean => hasPermission('run-import'),
109109
},
110110
{
111-
href: '/admin/reports',
111+
href: '/admin/analytic-reports',
112112
i18nLabel: 'Reports',
113113
icon: 'post',
114114
permissionGranted: (): boolean => hasPermission('view-logs'),

apps/meteor/client/views/admin/viewLogs/ServerLogs.tsx

Lines changed: 0 additions & 223 deletions
This file was deleted.

apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,18 @@
1-
import { Margins, Tabs } from '@rocket.chat/fuselage';
21
import type { ReactElement } from 'react';
3-
import { useState } from 'react';
42
import { useTranslation } from 'react-i18next';
53

64
import AnalyticsReports from './AnalyticsReports';
7-
import ServerLogs from './ServerLogs';
85
import { Page, PageHeader, PageContent } from '../../../components/Page';
96

107
const ViewLogsPage = (): ReactElement => {
118
const { t } = useTranslation();
12-
const [tab, setTab] = useState('Logs');
139

1410
return (
1511
<Page background='tint'>
16-
<PageHeader title={t('Reports')} />
17-
<Margins blockEnd={24}>
18-
<Tabs>
19-
<Tabs.Item onClick={() => setTab('Logs')} selected={tab === 'Logs'}>
20-
{t('Logs')}
21-
</Tabs.Item>
22-
<Tabs.Item onClick={() => setTab('Analytics')} selected={tab === 'Analytics'}>
23-
{t('Analytic_reports')}
24-
</Tabs.Item>
25-
</Tabs>
26-
</Margins>
27-
<PageContent>{tab === 'Logs' ? <ServerLogs /> : <AnalyticsReports />}</PageContent>
12+
<PageHeader title={t('Analytic_reports')} />
13+
<PageContent>
14+
<AnalyticsReports />
15+
</PageContent>
2816
</Page>
2917
);
3018
};

apps/meteor/server/configuration/configureLogLevel.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { setQueueLimit, logLevel, type LogLevelSetting } from '@rocket.chat/logger';
1+
import { logLevel, type LogLevelSetting } from '@rocket.chat/logger';
22
import { Settings } from '@rocket.chat/models';
33

44
import type { ICachedSettings } from '../../app/settings/server/CachedSettings';
@@ -14,10 +14,4 @@ export async function configureLogLevel(settings: ICachedSettings) {
1414
logLevel.emit('changed', String(value) as LogLevelSetting);
1515
}
1616
});
17-
18-
settings.watch('Log_View_Limit', (value) => {
19-
if (typeof value === 'number') {
20-
setQueueLimit(value);
21-
}
22-
});
2317
}

apps/meteor/server/modules/notifications/notifications.module.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export class NotificationsModule {
3939

4040
public readonly streamLivechatQueueData: IStreamer<'livechat-inquiry-queue-observer'>;
4141

42-
public readonly streamStdout: IStreamer<'stdout'>;
43-
4442
public readonly streamRoomData: IStreamer<'room-data'>;
4543

4644
public readonly streamLocal: IStreamer<'local'>;
@@ -60,7 +58,6 @@ export class NotificationsModule {
6058
this.streamIntegrationHistory = new this.Streamer('integrationHistory');
6159
this.streamLivechatRoom = new this.Streamer('livechat-room');
6260
this.streamLivechatQueueData = new this.Streamer('livechat-inquiry-queue-observer');
63-
this.streamStdout = new this.Streamer('stdout');
6461
this.streamRoomData = new this.Streamer('room-data');
6562
this.streamPresence = StreamPresence.getInstance(Streamer, 'user-presence');
6663
this.streamRoomMessage = new this.Streamer('room-messages');
@@ -348,14 +345,6 @@ export class NotificationsModule {
348345
return this.userId ? Authorization.hasPermission(this.userId, 'view-l-room') : false;
349346
});
350347

351-
this.streamStdout.allowWrite('none');
352-
this.streamStdout.allowRead(async function () {
353-
if (!this.userId) {
354-
return false;
355-
}
356-
return Authorization.hasPermission(this.userId, 'view-logs');
357-
});
358-
359348
this.streamRoomData.allowWrite('none');
360349
this.streamRoomData.allowRead(async function (rid) {
361350
if (!this.userId) {

apps/meteor/server/settings/logs.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ export const createLogSettings = () =>
2020
],
2121
public: true,
2222
});
23-
await this.add('Log_View_Limit', 1000, {
24-
type: 'int',
25-
});
2623

2724
await this.add('Log_Trace_Methods', false, {
2825
type: 'boolean',

apps/meteor/server/startup/migrations/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ import './v319';
2828
import './v320';
2929
import './v321';
3030
import './v322';
31+
import './v324';
3132

3233
export * from './xrun';

0 commit comments

Comments
 (0)