[英]How to listen to different channels of logs of NodeJS running NestJS in a Docker container?
I have a NestJS application running in a Docker container.我有一个在 Docker 容器中运行的 NestJS 应用程序。 I have two loggers;
我有两个记录器; the NestJS Logger and Pino.
NestJS 记录器和 Pino。
Pino is responsible for listening to requests and responses and printing them to the console, while I use the NestJS logger to print custom messages I output, and for logging errors and the such. Pino 负责监听请求和响应并将它们打印到控制台,而我使用 NestJS 记录器打印我输出的自定义消息,并记录错误等。
I essentially want to open two terminal windows for each one of the loggers and only get logs by one of the two on each.我基本上想为每个记录器打开两个终端窗口,并且每个记录器只获取两个记录之一。 How would I go about accomplishing this?
我将如何实现这一目标?
您可以配置在执行时将每个日志保存在两个不同的文件中,例如:req-res-log.txt 和 custom-log.txt,打开终端窗口后使用命令“tail -f -n100 file-path " 在测试期间显示日志。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.