mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2025-04-13 09:44:40 +00:00
don't log query parameters from mastodon API
This commit is contained in:
parent
fc1d0c958c
commit
8d67a8c9ae
1 changed files with 4 additions and 2 deletions
|
@ -4,11 +4,12 @@
|
|||
*/
|
||||
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { FastifyRequest } from 'fastify';
|
||||
import Logger from '@/logger.js';
|
||||
import { LoggerService } from '@/core/LoggerService.js';
|
||||
import { ApiError } from '@/server/api/error.js';
|
||||
import { EnvService } from '@/core/EnvService.js';
|
||||
import { FastifyRequest } from 'fastify';
|
||||
import { getBaseUrl } from '@/server/api/mastodon/MastodonClientService.js';
|
||||
|
||||
@Injectable()
|
||||
export class MastodonLogger {
|
||||
|
@ -25,7 +26,8 @@ export class MastodonLogger {
|
|||
|
||||
public error(request: FastifyRequest, error: MastodonError, status: number): void {
|
||||
if ((status < 400 && status > 499) || this.envService.env.NODE_ENV === 'development') {
|
||||
this.logger.error(`Error in mastodon endpoint ${request.method} ${request.url}:`, error);
|
||||
const path = new URL(request.url, getBaseUrl(request)).pathname;
|
||||
this.logger.error(`Error in mastodon endpoint ${request.method} ${path}:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue