logtail-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logtail-rails/tasks/logtail.rake +6 -4
- data/lib/logtail-rails/version.rb +1 -1
- 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: e8a2816aef51d0ea967a9442a2f564e52688eb284221db42fa5e70ce5bf958df
|
4
|
+
data.tar.gz: 9bc07029b6fc8b5312f4b71c391b7fc5ac1097f4d5610ffb397efbfd333bdc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aabbf1f5c8f2b6ae439534d2fb01b9438d304c03edbc1de6383fd28db60be866fc287d74c4ab213881f19a99feb95d87964120143b0ca954f732ec55453a59b1
|
7
|
+
data.tar.gz: e59e3bc6c3856972092e02907dc1a97f203c6508ddc648dd56db30aee9485f028d4352bf2f05ca11736a8491c09978a2e07fc488c46514a6b3fce6977ee4789a
|
@@ -1,10 +1,11 @@
|
|
1
1
|
namespace :logtail do
|
2
2
|
desc 'Install a default config/initializers/logtail.rb file'
|
3
3
|
|
4
|
-
|
4
|
+
PLACEHOLDER = '<SOURCE_TOKEN>'.freeze
|
5
|
+
def content(source_token = nil)
|
5
6
|
<<~RUBY
|
6
7
|
if ENV['LOGTAIL_SKIP_LOGS'].blank? && !Rails.env.test?
|
7
|
-
http_device = Logtail::LogDevices::HTTP.new('
|
8
|
+
http_device = Logtail::LogDevices::HTTP.new('#{source_token || PLACEHOLDER}')
|
8
9
|
Rails.logger = Logtail::Logger.new(http_device)
|
9
10
|
else
|
10
11
|
Rails.logger = Logtail::Logger.new(STDOUT)
|
@@ -15,6 +16,7 @@ namespace :logtail do
|
|
15
16
|
task install: :environment do
|
16
17
|
quiet = ENV['quiet']
|
17
18
|
force = ENV['force']
|
19
|
+
source_token = ENV['source_token']
|
18
20
|
|
19
21
|
config_file = 'config/initializers/logtail.rb'
|
20
22
|
|
@@ -23,7 +25,7 @@ namespace :logtail do
|
|
23
25
|
next
|
24
26
|
end
|
25
27
|
|
26
|
-
File.open(config_file, 'w') { |out| out.puts(content) }
|
28
|
+
File.open(config_file, 'w') { |out| out.puts(content(source_token)) }
|
27
29
|
|
28
30
|
puts <<~EOF unless quiet
|
29
31
|
Installed a default configuration file at #{config_file}.
|
@@ -31,7 +33,7 @@ namespace :logtail do
|
|
31
33
|
|
32
34
|
puts <<~EOF unless quiet
|
33
35
|
To monitor your logs in production mode, sign up for an account
|
34
|
-
at logtail.com, and replace the
|
36
|
+
at logtail.com, and replace the source token in the logtail.rb file
|
35
37
|
with the one you receive upon registration.
|
36
38
|
EOF
|
37
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logtail-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logtail
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logtail
|