🔊 oo-connector: output JSON logs in production (#740)

if NODE_ENV=production, then log in JSON format
This commit is contained in:
ericlinagora
2024-11-25 10:59:25 +01:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
@@ -16,6 +16,8 @@ export const {
OOCONNECTOR_HEALTH_SECRET,
} = process.env;
export const isProductionEnv = (NODE_ENV ?? '').toLocaleLowerCase().trim() === 'production';
const secs = 1000,
mins = 60 * secs;
@@ -1,5 +1,7 @@
import { Logger } from 'tslog';
import { isProductionEnv } from '../config';
export default new Logger({
name: 'twake-onlyoffice-plugin',
type: isProductionEnv ? 'json' : 'pretty',
});