0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/loggingrc.js

25 lines
674 B
JavaScript
Raw Normal View History

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');
// 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.safe
};
module.exports = loggingConfig;