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');
|
2023-01-20 14:51:03 +03:00
|
|
|
loggingConfig.metadata = {
|
|
|
|
version: ghostVersion.original
|
|
|
|
};
|
2021-11-16 18:00:11 +03:00
|
|
|
|
|
|
|
// 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'),
|
2022-08-04 20:22:57 +03:00
|
|
|
version: ghostVersion.original
|
2021-06-15 17:36:27 +03:00
|
|
|
};
|
2021-11-16 18:00:11 +03:00
|
|
|
|
|
|
|
module.exports = loggingConfig;
|