mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-27 04:43:12 +03:00
8f8fcbd5e9
- up until now, we've been sending the `safe` version as data in metrics, but this only includes major.minor - we'd like to be able to see how every release affects the results, so this commit switches to using the version that was supplied in the package.json so we've got more of a granular overview
25 lines
678 B
JavaScript
25 lines
678 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');
|
|
|
|
// 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;
|