xstoudi / pino-pg Goto Github PK
View Code? Open in Web Editor NEWA Pino Transport for PostgreSQL databases.
License: MIT License
A Pino Transport for PostgreSQL databases.
License: MIT License
implemented this way
nodemon index.js | pino-pg --connectionUrl postgresql://xxx:xxx@xxx:5432/holmok --table holmok_me.logs --column log | pino-tiny,
I installed the latest version an I am getting the following error:
Error: Cannot find module './args'
Require stack:
- /Users/christopher.holmok/work/holmok.me/node_modules/pino-pg/dist/src/index.js
- /Users/christopher.holmok/work/holmok.me/node_modules/pino-pg/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Module.require (internal/modules/cjs/loader.js:1040:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/christopher.holmok/work/holmok.me/node_modules/pino-pg/dist/src/index.js:9:32)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1040:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/christopher.holmok/work/holmok.me/node_modules/pino-pg/dist/src/index.js',
'/Users/christopher.holmok/work/holmok.me/node_modules/pino-pg/index.js'
]
}
I am getting this while using it with esm package
$ nodemon -r esm -e yaml,js,json index | pino-pg --connectionUrl postgres://xxx:[email protected]:5432/easycollab --table test.logs --column log
SyntaxError: Unexpected token in JSON at position 0
at JSON.parse (<anonymous>)
at /Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:36:100
at Generator.next (<anonymous>)
at resume (/Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:15:44)
at fulfill (/Users/shivam/real-dev/easy-collab-api/node_modules/pino-pg/dist/src/index.js:17:31)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Currently the code creates a new connection for each chunk.
This approach is going to fail under high throughput.
I would recommend
Hello,
I'm facing a problem using pino-pg
On my package.json, scripts area I have the following:
"dev": "nodemon --exec babel-node ./api/index.js | pino-pg --connectionUrl postgresql://xxxxxx:[email protected]:5432/dbname --table pinologs --column log",
But when running on console the command "npm run dev" the following appears:
internal/streams/pipeline.js:27
stream.on('close', () => {
^
TypeError: stream.on is not a function
at destroyer (internal/streams/pipeline.js:27:10)
at internal/streams/pipeline.js:79:12
at Array.map (<anonymous>)
at Function.pipeline (internal/streams/pipeline.js:76:28)
at client.connect (D:\Work\Project\node_modules\pino-pg\dist\src\index.js:57:18)
at Connection.<anonymous> (D:\Work\Project\node_modules\pino-pg\node_modules\pg\lib\client.js:253:7)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:187:15)
at parse (D:\Work\Project\node_modules\pino-pg\node_modules\pg\lib\connection.js:109:10)
at Parser.parse (D:\Work\Project\node_modules\pino-pg\node_modules\pg-protocol\dist\parser.js:40:17)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.