govuk_app_config 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -6
- data/README.md +1 -1
- data/lib/govuk_app_config/govuk_logging.rb +17 -16
- data/lib/govuk_app_config/version.rb +1 -1
- data/lib/govuk_app_config.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 629e8bd24b9422af13b87da654890af10134751f9d8b74e5afdf4eada6a70978
|
4
|
+
data.tar.gz: ea026c299d154655ccec7e6e1d2925e044e2457fc2c55e21d511635a442cee70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19f52425763d71a8dc15f0429f67333e3ceda68092535371c5530efeb1dbc5ed73a829e916af6e2f8200543b73bb9f1c4c5ea39e1c4b24f46d920c3906752ab0
|
7
|
+
data.tar.gz: d3b1cf2e316962ee61ce2eefae6652bae6726d8378dd58d90bc03eccf146ca10bc7e417fe8e9de7fb4cf884e2419ea79e7d8601e61ed4b1906a481a318f6cc83
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
# 1.3.2
|
2
|
+
|
3
|
+
* Update instructions to suggest that GovukUnicorn should be required directly
|
4
|
+
`require "govuk_app_config/govuk_unicorn"` rather than passively through
|
5
|
+
`require "govuk_app_config"` to isolate it from other configuration.
|
6
|
+
* Move STDOUT/STDERR configuration inside GovukLogging module to reduce side
|
7
|
+
effects when gem is initialised.
|
8
|
+
|
9
|
+
### How to upgrade
|
10
|
+
|
11
|
+
* In your applications `config/unicorn.rb` file change
|
12
|
+
`require "govuk_app_config"` to `require "govuk_app_config/govuk_unicorn"`
|
13
|
+
|
1
14
|
# 1.3.1
|
2
15
|
|
3
16
|
* Fix collection of Statsd gauge metrics
|
@@ -11,7 +24,7 @@
|
|
11
24
|
* Find or create a config/unicorn.rb file in the app
|
12
25
|
* At the top of the file insert:
|
13
26
|
```rb
|
14
|
-
require "govuk_app_config"
|
27
|
+
require "govuk_app_config/govuk_unicorn"
|
15
28
|
GovukUnicorn.configure(self)
|
16
29
|
```
|
17
30
|
* If the app has the following, remove it:
|
@@ -54,13 +67,13 @@
|
|
54
67
|
* If the app has any of the following (likely in `config/environments/production.rb`), remove it:
|
55
68
|
```rb
|
56
69
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
57
|
-
config.log_formatter = ::Logger::Formatter.new
|
70
|
+
config.log_formatter = ::Logger::Formatter.new
|
58
71
|
|
59
|
-
# Use a different logger for distributed setups.
|
60
|
-
# require 'syslog/logger'
|
61
|
-
config.logger = ActiveSupport::TaggedLogging.new(Logger.new($stderr))
|
72
|
+
# Use a different logger for distributed setups.
|
73
|
+
# require 'syslog/logger'
|
74
|
+
config.logger = ActiveSupport::TaggedLogging.new(Logger.new($stderr))
|
62
75
|
|
63
|
-
$real_stdout = $stdout.clone
|
76
|
+
$real_stdout = $stdout.clone
|
64
77
|
$stdout.reopen($stderr)
|
65
78
|
```
|
66
79
|
|
data/README.md
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
# Rails applications have 2 outputs types:
|
2
|
-
#
|
3
|
-
# 1) Structured logging statements like the ones we create with
|
4
|
-
# `Rails.logger.info` and Rails request logging, which we do with the logstasher
|
5
|
-
# gem. These logs are output in JSON and can be read easily by our logging
|
6
|
-
# stack.
|
7
|
-
#
|
8
|
-
# 2) The second are logs that are outputted when an exception occurs or `puts`
|
9
|
-
# is used directly. This is unstructured text. Often this logging is sent to
|
10
|
-
# STDOUT directly.
|
11
|
-
#
|
12
|
-
# We want to differentiate between the two types. To do this, we direct all log
|
13
|
-
# statements that would _normally_ go to STDOUT to STDERR. This frees up the "real
|
14
|
-
# stdout" for use by our loggers.
|
15
|
-
$real_stdout = $stdout.clone
|
16
|
-
$stdout.reopen($stderr)
|
17
1
|
|
18
2
|
require 'logstasher'
|
19
3
|
|
20
4
|
module GovukLogging
|
21
5
|
def self.configure
|
6
|
+
# Rails applications have 2 outputs types:
|
7
|
+
#
|
8
|
+
# 1) Structured logging statements like the ones we create with
|
9
|
+
# `Rails.logger.info` and Rails request logging, which we do with the logstasher
|
10
|
+
# gem. These logs are output in JSON and can be read easily by our logging
|
11
|
+
# stack.
|
12
|
+
#
|
13
|
+
# 2) The second are logs that are outputted when an exception occurs or `puts`
|
14
|
+
# is used directly. This is unstructured text. Often this logging is sent to
|
15
|
+
# STDOUT directly.
|
16
|
+
#
|
17
|
+
# We want to differentiate between the two types. To do this, we direct all log
|
18
|
+
# statements that would _normally_ go to STDOUT to STDERR. This frees up the "real
|
19
|
+
# stdout" for use by our loggers.
|
20
|
+
$real_stdout = $stdout.clone
|
21
|
+
$stdout.reopen($stderr)
|
22
|
+
|
22
23
|
# Send Rails' logs to STDERR because they're not JSON formatted.
|
23
24
|
Rails.logger = ActiveSupport::TaggedLogging.new(Logger.new($stderr, level: Logger::INFO))
|
24
25
|
|
data/lib/govuk_app_config.rb
CHANGED
@@ -2,6 +2,8 @@ require "govuk_app_config/version"
|
|
2
2
|
require "govuk_app_config/govuk_statsd"
|
3
3
|
require "govuk_app_config/govuk_error"
|
4
4
|
require "govuk_app_config/govuk_logging"
|
5
|
+
# This require is deprecated and should be removed on next major version bump
|
6
|
+
# and should be required by applications directly.
|
5
7
|
require "govuk_app_config/govuk_unicorn"
|
6
8
|
require "govuk_app_config/configure"
|
7
9
|
require "govuk_app_config/railtie" if defined?(Rails)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: statsd-ruby
|