Comments (8)
No worries at all! Glad you got to the bottom of it 👍🏾
from pino-cloud-js.
Please share the code you're using to configure pino @thelinuxlich
from pino-cloud-js.
Here it comes
import { getPinoOptions } from '@relaycorp/pino-cloud'
import pino from 'pino'
import pretty from 'pino-pretty'
export const logSettings =
process.env.NODE_ENV === 'localhost'
? pretty({
colorize: true,
colorizeObjects: true,
translateTime: 'SYS:yyyy-mm-dd HH:MM:ss',
ignore: 'pid,hostname',
})
: getPinoOptions('gcp', { name: 'rise' })
export const logger = pino(logSettings)
from pino-cloud-js.
It looks like NODE_ENV === 'localhost'
on GCP. Are you sure that's not the case?
I've never seen this behaviour, and I use this lib on GKE and Cloud Run.
from pino-cloud-js.
oh the env variable is okay, otherwise I wouldn't receive the JSON format on Google and other things wouldn't work. It's really really weird
from pino-cloud-js.
The screenshot you shared is what I'd expect to see if pretty(...)
was being used. Log entries are always shown as JSON documents on Google Logging, but note that textPayload
is a string.
Please try this:
import { getPinoOptions } from '@relaycorp/pino-cloud'
import pino from 'pino'
export const logSettings = getPinoOptions('gcp', { name: 'rise' })
export const logger = pino(logSettings)
from pino-cloud-js.
Another proof is that when logging to localhost, pino-pretty doesn't have that severity
property, maybe I need to configure something on GCP to convert this to structured logging and this has nothing to do with the library...
from pino-cloud-js.
Solved it, it was my Dockerfile running the service with turbo
and Turbo adds a prefix, I feel so dumb, sorry for taking your attention for nothing
from pino-cloud-js.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pino-cloud-js.