Skip to content

Logger layouts are not exported correctly? #3192

@ThanatosGit

Description

@ThanatosGit

When you use the "json" layout as logger as suggested here https://tsed.dev/docs/logger.html#use-json-layout-in-production, you just see the message

Missing json layout doesn't exists.
Have you imported the @tsed/logger/layouts/JsonLayout module in your code?

If you use the suggested import, you just get:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/thanatos/projects/tsed/test-logger/node_modules/@tsed/logger/lib/esm/layouts/components/JsonLayout' imported from /home/thanatos/projects/tsed/test-logger/src/config/logger/index.ts
Did you mean to import "@tsed/logger/lib/esm/layouts/components/JsonLayout.js"?

You have to import it via import "@tsed/logger/layouts/JsonLayout.js" which can be easily added to the documentation and auto generated code from tsed/cli but maybe the layouts should be exported by @tsed/logger instead of referencing some internal paths?
Though the components were explicitly omitted from barrelsby by this commit / refactor. tsedio/logger@56f95a1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions