2021-06-15 17:36:27 +03:00
|
|
|
const config = require('./core/shared/config');
|
2021-10-13 13:29:14 +03:00
|
|
|
const ghostVersion = require('@tryghost/version');
|
2017-01-23 14:04:01 +03:00
|
|
|
|
2021-11-16 18:00:11 +03:00
|
|
|
// 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'),
|
2017-02-17 17:29:25 +03:00
|
|
|
domain: config.get('url'),
|
2021-11-16 18:00:11 +03:00
|
|
|
version: ghostVersion.safe
|
2021-06-15 17:36:27 +03:00
|
|
|
};
|
2021-11-16 18:00:11 +03:00
|
|
|
|
|
|
|
module.exports = loggingConfig;
|