Skip to content

Commit ac2fcf9

Browse files
committed
logging page
1 parent fd5e58e commit ac2fcf9

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/modules/system/logs_http.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,14 @@ export class LogsHttp {
44
constructor(private logsRepository: LogsRepository) {}
55

66
async getLogsPageVariables(request: any, response: any): Promise<any> {
7-
let excludeLevels: string[] = request.query.exclude_levels || [];
7+
// Check for query params (support both exclude_levels and exclude_levels[])
8+
let excludeLevels: string[] = request.query.exclude_levels || request.query['exclude_levels[]'] || ['debug'];
9+
810
// Ensure it's always an array (Express sends single value as string)
911
if (typeof excludeLevels === 'string') {
1012
excludeLevels = [excludeLevels];
1113
}
1214

13-
if (excludeLevels.length === 0 && !('filters' in request.cookies)) {
14-
excludeLevels = ['debug'];
15-
}
16-
17-
response.cookie('filters', excludeLevels, {
18-
maxAge: 60 * 60 * 24 * 30 * 1000
19-
});
20-
2115
return {
2216
logs: await this.logsRepository.getLatestLogs(excludeLevels),
2317
levels: await this.logsRepository.getLevels(),

0 commit comments

Comments
 (0)