hubrise_initializer 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -2
- data/lib/hubrise_initializer/version.rb +1 -1
- data/lib/hubrise_initializer.rb +10 -13
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45fb130be84b2efa48bb2f12d55dd7cb6b8317024a499ef235d3147e5369ebd2
|
|
4
|
+
data.tar.gz: 2c10bf4fad684afbfd4ea1e46df5ede030d1280e815fa44f03a45fa73af67d92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ee262e8887201121d64dd34311aae1ab827fe57c99c4fc6d881ed9130d969f982fdaafbc9e9329aeca0b69d3802fcd955381cc67011f7ac1fa458346aad7cd4
|
|
7
|
+
data.tar.gz: e5d7f33383067d08b404e013b98ca3eb588a942e0eb57a8fd92b5d6e7db919e4fe1c679fa1df55b1c6fbc4012f5ced4fd9ea76549e82487f958c8bbc3960d1a5
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -11,7 +11,7 @@ gem 'hubrise_initializer'
|
|
|
11
11
|
|
|
12
12
|
In `config/application.rb`:
|
|
13
13
|
```
|
|
14
|
-
HubriseInitializer.configure(:logger, :
|
|
14
|
+
HubriseInitializer.configure(:logger, :web_console)
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Configuration
|
|
@@ -47,7 +47,8 @@ To upload the latest version to RubyGems.org:
|
|
|
47
47
|
2. Tag the repository:
|
|
48
48
|
```bash
|
|
49
49
|
bundle install
|
|
50
|
-
VERSION=1.0.
|
|
50
|
+
VERSION=1.0.4
|
|
51
|
+
git add Gemfile.lock
|
|
51
52
|
git add lib/hubrise_initializer/version.rb
|
|
52
53
|
git commit -m "Version $VERSION"
|
|
53
54
|
git tag v$VERSION
|
|
@@ -61,4 +62,5 @@ git push
|
|
|
61
62
|
rm -f hubrise_initializer-*.gem
|
|
62
63
|
gem build hubrise_initializer
|
|
63
64
|
gem push hubrise_initializer-*.gem
|
|
65
|
+
rm -f hubrise_initializer-*.gem
|
|
64
66
|
```
|
data/lib/hubrise_initializer.rb
CHANGED
|
@@ -12,8 +12,6 @@ class HubriseInitializer
|
|
|
12
12
|
case initializer
|
|
13
13
|
when :logger
|
|
14
14
|
configure_logger
|
|
15
|
-
when :delayed_job_logger
|
|
16
|
-
configure_delayed_job_logger
|
|
17
15
|
when :web_console
|
|
18
16
|
configure_web_console
|
|
19
17
|
end
|
|
@@ -60,23 +58,22 @@ class HubriseInitializer
|
|
|
60
58
|
# Log to a file (Rails default)
|
|
61
59
|
end
|
|
62
60
|
end
|
|
61
|
+
|
|
62
|
+
if defined?(ActiveJob)
|
|
63
|
+
configure_active_job_logger
|
|
64
|
+
end
|
|
63
65
|
end
|
|
64
66
|
|
|
65
|
-
def
|
|
67
|
+
def configure_active_job_logger
|
|
66
68
|
Rails.application.configure do
|
|
67
|
-
|
|
68
|
-
when "stdout"
|
|
69
|
-
#
|
|
69
|
+
ActiveJob::Base.logger = case ENV["RAILS_LOGGER"]
|
|
70
|
+
when "stdout", "fluentd"
|
|
71
|
+
# Do not send ActiveJobs logs to fluentd as this would create new Elasticsearch entries detached from the
|
|
72
|
+
# request.
|
|
70
73
|
ActiveSupport::Logger.new(STDOUT)
|
|
71
74
|
|
|
72
|
-
when "fluentd"
|
|
73
|
-
# Log to fluentd (kubernetes)
|
|
74
|
-
# ENV['FLUENTD_URL'] is used internally by this logger
|
|
75
|
-
ActFluentLoggerRails::Logger.new
|
|
76
|
-
|
|
77
75
|
else
|
|
78
|
-
|
|
79
|
-
ActiveSupport::Logger.new(File.join(Rails.root, "log", "delayed_job.log"))
|
|
76
|
+
ActiveSupport::Logger.new(File.join(Rails.root, "log", "active_job.log"))
|
|
80
77
|
end
|
|
81
78
|
end
|
|
82
79
|
end
|