0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/test/unit
Katharina Irrgang 0e13ef8767 🎨 logging improvements (#7597)
* 🎨  rotation config
  - every parameter is configureable
  - increase default number of files to 100
* 🎨  ghost.log location
  - example: content/logs/http___my_ghost_blog_com_ghost.log
  - user can change the path to something custom by setting logging.path
* 🛠   add response-time as dependency
* 🎨  readable PrettyStream
  - tidy up
  - generic handling (was important to support more use cases, for example: logging.info({ anyKey: anyValue }))
  - common log format
  - less code 🕵🏻
* 🎨  GhostLogger cleanup
  - remove setLoggers -> this function had too much of redundant code
  - instead: add smart this.log function
  - remove logging.request (---> GhostLogger just forwards the values, it doesn't matter if that is a request or not a request)
  - make .warn .debug .info .error small and smart
* 🎨  app.js: add response time as middleware and remove logging.request
* 🎨  setStdoutStream and setFileStream
  - redesign GhostLogger to add CustomLoggers very easily

----> Example CustomLogger

function CustomLogger(options) {
  // Base iterates over defined transports
  // EXAMPLE: ['stdout', 'elasticsearch']
  Base.call(this, options);
}
util.inherits(...);

// OVERRIDE default stdout stream and your own!!!
CustomLogger.prototype.setStdoutStream = function() {}

// add a new stream
// get's called automatically when transport elasticsearch is defined
CustomLogger.prototype.setElasticsearchStream = function() {}

* 🎨  log into multiple file by default
  - content/logs/domain.error.log --> contains only the errors
  - content/logs/domain.log --> contains everything
  - rotation for both files
* 🔥  remove logging.debug and use npm debug only
*   shortcuts for mode and level
* 🎨  jshint/jscs
* 🎨  stdout as much as possible for an error
* 🎨  fix tests
* 🎨  remove req.ip from log output, remove response-time dependency
* 🎨  create middleware for logging
  - added TODO to move logging middleware to ignition
2016-10-25 12:17:43 +01:00
..
api 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
auth change ghost client redirect_uri (#7595) 2016-10-21 16:08:17 +01:00
config 🎨 make sqlite filename absolute (#7585) 2016-10-18 09:04:44 +01:00
controllers/frontend Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
logging 🎨 logging improvements (#7597) 2016-10-25 12:17:43 +01:00
mail 🎨 Use GhostAuth name and example emails (#7475) 2016-10-03 15:11:43 +01:00
metadata Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
middleware 🎉 🎨 Remove middleware/index.js (#7548) 2016-10-13 17:24:09 +02:00
models/base improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
models_plugins change default order of posts (#7096) 2016-07-15 11:04:10 +01:00
scheduling Error creation (#7477) 2016-10-06 13:27:35 +01:00
server_helpers 🔥 Remove the deprecated body classes (#7510) 2016-10-10 11:38:12 +02:00
sitemap 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
storage Error creation (#7477) 2016-10-06 13:27:35 +01:00
utils add token utils (#7554) 2016-10-13 13:54:44 +01:00
api_utils_spec.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
apps_filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
apps_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
errors_spec.js 🐛 GhostError needs to inherit from Error (#7582) 2016-10-19 15:27:22 +01:00
exporter_spec.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
filters_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
ghost_url_spec.js 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
importer_spec.js feature: upload validation middleware (#7208) 2016-08-18 20:25:51 +01:00
migration_fixture_utils_spec.js 🎨 Separate invites from user 2016-09-26 11:08:43 +02:00
migration_spec.js use migration runner for init db (#7502) 2016-10-11 13:37:11 +01:00
permissions_spec.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
rss_spec.js Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
server_helpers_index_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_helpers_template_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
server_spec.js knex migrator (#7565) 2016-10-17 13:50:29 +01:00
server_utils_spec.js 🎨 change gravatar file design (#7553) 2016-10-13 13:52:22 +01:00
showdown_client_integrated_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
slack_spec.js 🎨 source out url utils from ConfigManager (#7347) 2016-09-20 15:59:34 +01:00
social-urls_spec.js improvement: jshint/jscs 2016-06-17 22:59:47 +02:00
utils_pipeline_spec.js Update mocha to version 3.0.2 🚀 (#7165) 2016-08-11 08:51:19 +01:00
validation_spec.js 🐛 Subscribers: validate urls (#7540) 2016-10-14 16:31:20 +02:00
versioning_spec.js migrations: seeding is part of init db task (#7545) 2016-10-12 16:18:57 +01:00
xmlrpc_spec.js 🎨 replace process.env.NODE_ENV usages by config.get('env') (#7544) 2016-10-11 13:53:52 +01:00