🔊 oo-connector: output JSON logs in production
This commit is contained in:
@@ -16,6 +16,8 @@ export const {
|
|||||||
OOCONNECTOR_HEALTH_SECRET,
|
OOCONNECTOR_HEALTH_SECRET,
|
||||||
} = process.env;
|
} = process.env;
|
||||||
|
|
||||||
|
export const isProductionEnv = (NODE_ENV ?? '').toLocaleLowerCase().trim() === 'production';
|
||||||
|
|
||||||
const secs = 1000,
|
const secs = 1000,
|
||||||
mins = 60 * secs;
|
mins = 60 * secs;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { Logger } from 'tslog';
|
import { Logger } from 'tslog';
|
||||||
|
import { isProductionEnv } from '../config';
|
||||||
|
|
||||||
export default new Logger({
|
export default new Logger({
|
||||||
name: 'twake-onlyoffice-plugin',
|
name: 'twake-onlyoffice-plugin',
|
||||||
|
type: isProductionEnv ? 'json' : 'pretty',
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user