🔊 oo-connector: output JSON logs in production (#740)
if NODE_ENV=production, then log in JSON format
This commit is contained in:
@@ -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',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user