# PlatformLogMiddleware Class middleware platform

Module
import { PlatformLogMiddleware } from "@tsed/common"
Source/packages/common/src/platform/middlewares/PlatformLogMiddleware.ts

# Overview

class PlatformLogMiddleware implements IMiddleware {
    protected static DEFAULT_FIELDS: string[];
    $onResponse: any;
    protected settings: PlatformLoggerSettings;
    constructor(injector: InjectorService);
    /**
     * Handle the request.
     */
    use(ctx: Context): void;
    /**
     * The separate onLogStart() function will allow developer to overwrite the initial request log.
     * @param ctx
     */
    protected onLogStart(ctx: Context): void;
    /**
     * Called when the `$onResponse` is called by Ts.ED (through Express.end).
     */
    protected onLogEnd(ctx: Context): void;
    /**
     * Attach all information that will be necessary to log the request. Attach a new `request.log` object.
     */
    protected configureRequest(ctx: Context): void;
    /**
     * Return complete request info.
     * @returns {Object}
     * @param ctx
     */
    protected requestToObject(ctx: Context): any;
    /**
     * Return a filtered request from global configuration.
     * @returns {Object}
     * @param ctx
     */
    protected minimalRequestPicker(ctx: Context): any;
}

# Members

protected static DEFAULT_FIELDS: string[];

$onResponse: any;

protected settings: PlatformLoggerSettings;

use(ctx: Context): void;

Handle the request.


protected onLogStart(ctx: Context): void;

The separate onLogStart() function will allow developer to overwrite the initial request log.


protected onLogEnd(ctx: Context): void;

Called when the $onResponse is called by Ts.ED (through Express.end).


protected configureRequest(ctx: Context): void;

Attach all information that will be necessary to log the request. Attach a new request.log object.


protected requestToObject(ctx: Context): any;

Return complete request info.


protected minimalRequestPicker(ctx: Context): any;

Return a filtered request from global configuration.