mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
f2116357b7
refs: https://github.com/TryGhost/Toolbox/issues/502 Updated to @tryghost/logging@2.4.0 to allow metadata to be logged
28 lines
743 B
JavaScript
28 lines
743 B
JavaScript
const config = require('./core/shared/config');
|
|
const ghostVersion = require('@tryghost/version');
|
|
|
|
// Config for logging
|
|
const loggingConfig = config.get('logging') || {};
|
|
|
|
if (!loggingConfig.path) {
|
|
loggingConfig.path = config.getContentPath('logs');
|
|
}
|
|
|
|
// Additional values used by logging
|
|
loggingConfig.env = config.get('env');
|
|
loggingConfig.domain = config.get('url');
|
|
loggingConfig.metadata = {
|
|
version: ghostVersion.original
|
|
};
|
|
|
|
// Config for metrics
|
|
loggingConfig.metrics = config.get('logging:metrics') || {};
|
|
loggingConfig.metrics.metadata = {
|
|
// Undefined if unavailable
|
|
siteId: config.get('hostSettings:siteId'),
|
|
domain: config.get('url'),
|
|
version: ghostVersion.original
|
|
};
|
|
|
|
module.exports = loggingConfig;
|