Skip to content

Instantly share code, notes, and snippets.

@miroswd
Created July 1, 2022 19:38
Show Gist options
  • Save miroswd/7a8c415c17a7dff00310a68b95a516cc to your computer and use it in GitHub Desktop.
Save miroswd/7a8c415c17a7dff00310a68b95a516cc to your computer and use it in GitHub Desktop.
import pino from 'pino';
const environment = process.env.ENVIRONMENT || "dev";
const logger = pino({
transport: {
target: "pino-pretty"
},
base: {
pid: environment.toUpperCase()
},
timestamp: () => `,"time":"${new Intl.DateTimeFormat("pt-br", {
dateStyle: "long",
timeStyle: "long",
}).format(new Date())}"`
});
export default logger;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment