UNPKG

@totalsoft/pino-multitenancy

Version:
16 lines (12 loc) 421 B
// Copyright (c) TotalSoft. // This source code is licensed under the MIT license. import { tenantContextAccessor } from '@totalsoft/multitenancy-core' /** * Creates a pino mixin object containing the current tenant id * @returns - the pino mixin object */ function tenantIdMixin() { const tenant = tenantContextAccessor.getTenantContext()?.tenant return { tenantId: tenant?.id } } export default tenantIdMixin