I am trying to apply @elastic/ecs-pino-format to nestjs-pino. Under the good nestjs-pino is using http-pino. I have noticed that http-pino adds the request object inside [Symbol(pino.chindings)] and I am assuming it's using a child logger.So I tried to write a custom formatter for extracting the req by calling obj.res.log.bindings() and putting at http.request to be compliant with Elastic Common Schema (ecs). The problem I face is now my log contains duplicate the req and the http.request and can't find a way to remove it. Not sure if I am looking in the wrong direction but I have found a lot of issues trying to make nestjs-pino print Elastic Common Schema (ecs) format logs. Also I have noticed issues where @elastic/ecs-pino-format can't handle fastify. Has anyone had similar issues ?
HTTP Pino logger and Elastic Common Schema (ecs) format in NestJS
2.6k Views Asked by Georgios Kampitakis At
1
There are 1 best solutions below
Related Questions in NODE.JS
- clang::HeaderSearch search path ignored
- How can I store arbitrary data in LLVM metadata?
- Add LLVM to project using cmake
- Run All LLVM Passes
- Clang Tool: rewrite ObjCMessageExpr
- In LLVM LOOP PASS, I want to copy and paste a set of Instructions. error occurs when copy icmp and branch instruction
- LLVM Pass : DELETE all branch in the IR occurs errors
- How to find if an instruction post-dominates another in LLVM?
- LLVM JIT : matching structure member alignment with gcc
- Boost concurrency libraries behaving differently when compiled with GNU C++ / LLVM C++
Related Questions in NESTJS
- clang::HeaderSearch search path ignored
- How can I store arbitrary data in LLVM metadata?
- Add LLVM to project using cmake
- Run All LLVM Passes
- Clang Tool: rewrite ObjCMessageExpr
- In LLVM LOOP PASS, I want to copy and paste a set of Instructions. error occurs when copy icmp and branch instruction
- LLVM Pass : DELETE all branch in the IR occurs errors
- How to find if an instruction post-dominates another in LLVM?
- LLVM JIT : matching structure member alignment with gcc
- Boost concurrency libraries behaving differently when compiled with GNU C++ / LLVM C++
Related Questions in ELK
- clang::HeaderSearch search path ignored
- How can I store arbitrary data in LLVM metadata?
- Add LLVM to project using cmake
- Run All LLVM Passes
- Clang Tool: rewrite ObjCMessageExpr
- In LLVM LOOP PASS, I want to copy and paste a set of Instructions. error occurs when copy icmp and branch instruction
- LLVM Pass : DELETE all branch in the IR occurs errors
- How to find if an instruction post-dominates another in LLVM?
- LLVM JIT : matching structure member alignment with gcc
- Boost concurrency libraries behaving differently when compiled with GNU C++ / LLVM C++
Related Questions in PINOJS
- clang::HeaderSearch search path ignored
- How can I store arbitrary data in LLVM metadata?
- Add LLVM to project using cmake
- Run All LLVM Passes
- Clang Tool: rewrite ObjCMessageExpr
- In LLVM LOOP PASS, I want to copy and paste a set of Instructions. error occurs when copy icmp and branch instruction
- LLVM Pass : DELETE all branch in the IR occurs errors
- How to find if an instruction post-dominates another in LLVM?
- LLVM JIT : matching structure member alignment with gcc
- Boost concurrency libraries behaving differently when compiled with GNU C++ / LLVM C++
Related Questions in ELASTIC-COMMON-SCHEMA
- clang::HeaderSearch search path ignored
- How can I store arbitrary data in LLVM metadata?
- Add LLVM to project using cmake
- Run All LLVM Passes
- Clang Tool: rewrite ObjCMessageExpr
- In LLVM LOOP PASS, I want to copy and paste a set of Instructions. error occurs when copy icmp and branch instruction
- LLVM Pass : DELETE all branch in the IR occurs errors
- How to find if an instruction post-dominates another in LLVM?
- LLVM JIT : matching structure member alignment with gcc
- Boost concurrency libraries behaving differently when compiled with GNU C++ / LLVM C++
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
So I was confused with
pinoandpino-httpand how they were integrated in nestjs-pino. From the looks of it @elastic/ecs-pino-format doesn't handle all the specifics for Elastic Common Schema (ecs) inpino-http. So what I ended up doing was passing innestjs-pinoas a configuration a merge of the format object from @elastic/ecs-pino-format and configuringpino-http.pino-httpsupports passingfor changing the keys of
reqandres. As for the data thatreqandrescontain,http-pinohas another option for transforming themFor more information about pino HTTP options.
Hope this helps anyone facing the same problem or want nestjs with Elastic Common Schema (ecs) logs.
An example configuration passed to
http-pinofor having ECS format.