Skip to content

Home > @opengovsg/logging > Logger > setAction

Logger.setAction() method ​

Append action to this logger's action path **in place** (mutates).

⚠️ Mutation is shared: if this logger is reused across concurrent requests (e.g. a module-level singleton), the scope bleeds between them. Prefer Logger.scope() for request-scoped work.

Signature:

typescript
setAction(options: {
        action: string;
    }): Logger;

Parameters ​

ParameterTypeDescription
options{ action: string; }action: action name to append.

Returns:

Logger

The same logger instance, for chaining.