Ghost/ghost/core/loggingrc.js
Daniel Lockyer 8f8fcbd5e9
Switched to original version for metrics
- 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
2022-08-04 19:22:57 +02:00

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;