mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 02:51:51 +00:00
Replace winston with pino
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { PostHog } from "posthog-node";
|
||||
import { getLogger } from "../utils/logger";
|
||||
import { logger } from "../utils/logging";
|
||||
import { AuthData } from "../interfaces/middleware";
|
||||
import {
|
||||
getNodeEnv,
|
||||
@@ -22,13 +22,13 @@ class Telemetry {
|
||||
* Logs telemetry enable/disable notice.
|
||||
*/
|
||||
static logTelemetryMessage = async () => {
|
||||
|
||||
if(!(await getTelemetryEnabled())){
|
||||
(await getLogger("backend-main")).info([
|
||||
"",
|
||||
[
|
||||
"To improve, Infisical collects telemetry data about general usage.",
|
||||
"This helps us understand how the product is doing and guide our product development to create the best possible platform; it also helps us demonstrate growth as we support Infisical as open-source software.",
|
||||
"To opt into telemetry, you can set `TELEMETRY_ENABLED=true` within the environment variables.",
|
||||
].join("\n"))
|
||||
].forEach(line => logger.info(line));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import mongoose from "mongoose";
|
||||
import { createTerminus } from "@godaddy/terminus";
|
||||
import { getLogger } from "../utils/logger";
|
||||
import { logger } from "../utils/logging";
|
||||
|
||||
export const setUpHealthEndpoint = <T>(server: T) => {
|
||||
const onSignal = async () => {
|
||||
(await getLogger("backend-main")).info("Server is starting clean-up");
|
||||
logger.info("Server is starting clean-up");
|
||||
return Promise.all([
|
||||
new Promise((resolve) => {
|
||||
if (mongoose.connection && mongoose.connection.readyState == 1) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
getSmtpSecure,
|
||||
getSmtpUsername,
|
||||
} from "../config";
|
||||
import { getLogger } from "../utils/logger";
|
||||
import { logger } from "../utils/logging";
|
||||
|
||||
export const initSmtp = async () => {
|
||||
const mailOpts: SMTPConnection.Options = {
|
||||
@@ -84,15 +84,14 @@ export const initSmtp = async () => {
|
||||
.then(async () => {
|
||||
Sentry.setUser(null);
|
||||
Sentry.captureMessage("SMTP - Successfully connected");
|
||||
(await getLogger("backend-main")).info(
|
||||
"SMTP - Successfully connected"
|
||||
);
|
||||
logger.info("SMTP - Successfully connected");
|
||||
})
|
||||
.catch(async (err) => {
|
||||
Sentry.setUser(null);
|
||||
Sentry.captureException(
|
||||
`SMTP - Failed to connect to ${await getSmtpHost()}:${await getSmtpPort()} \n\t${err}`
|
||||
);
|
||||
logger.error(err, `SMTP - Failed to connect to ${await getSmtpHost()}:${await getSmtpPort()}`);
|
||||
});
|
||||
|
||||
return transporter;
|
||||
|
||||
Reference in New Issue
Block a user