@totalsoft/pino-multitenancy
Version:
Correlation id mixin for pino
15 lines (14 loc) • 545 B
JavaScript
;
// Copyright (c) TotalSoft.
// This source code is licensed under the MIT license.
Object.defineProperty(exports, "__esModule", { value: true });
const multitenancy_core_1 = require("@totalsoft/multitenancy-core");
/**
* Creates a pino mixin object containing the current tenant code
* @returns - the pino mixin object
*/
function tenantCodeMixin() {
const tenant = multitenancy_core_1.tenantContextAccessor.getTenantContext()?.tenant;
return { tenantCode: tenant?.code || 'NONE' };
}
exports.default = tenantCodeMixin;