tisoft-logging 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6cf7a2c762bafdb875bb9589bb48a2a4700affa9f42002292f6c7b89e1ac918c
4
- data.tar.gz: 291c03e4b7d2cb47ff1e4727ebde2a0156cbfb04f69f065b5f80b7fd8a32e92a
3
+ metadata.gz: 73362479b799caf5daef4b742f8ad905911ec24a5ccc18939b27bf012bdda2b6
4
+ data.tar.gz: 206e5cede77dc03dd5028ace14bfb5caf1d9d9e56ddabb80f01e7984a9327d40
5
5
  SHA512:
6
- metadata.gz: 9f58767e98148fc49a558a4a7215987d774e708c2d1ed7ef53c27fc786a513627d3a8bac7588cd80ee798238990a34c9a3902a5261a481972725f72439d260af
7
- data.tar.gz: ea849004df312b14f398806dff25e04993cc50318d31aaa011c8e373e618edea545de2134df654e49dfda4918cfe6daa2ca2497fb359d3d0db4fe28010249bfc
6
+ metadata.gz: '08d260cffc2cbb73080a6267ad120a2c64c2ea4cd571eca59d4c0a21bbf2f6886c974fdb0b7d4569e7a73f09f64bbeef2e3733b41255cbe81d2ff12da02d6b2f'
7
+ data.tar.gz: 9df0735800f6420c92948b3cdfedf1ae20f0fe721ca18c2cd00ea9a912b442869f5a0229a0baea5a3fed8fad36bf8ef094590892e738a22f226304ee2bc5a778
@@ -0,0 +1,30 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Set up Ruby 2.6
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: 2.6.x
20
+
21
+ - name: Publish to RubyGems
22
+ run: |
23
+ mkdir -p $HOME/.gem
24
+ touch $HOME/.gem/credentials
25
+ chmod 0600 $HOME/.gem/credentials
26
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
27
+ gem build *.gemspec
28
+ gem push *.gem
29
+ env:
30
+ GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
data/README.md CHANGED
@@ -30,6 +30,13 @@ My::Application.configure do
30
30
  end
31
31
  ```
32
32
 
33
+ ## Options
34
+
35
+ * config (required) - pass your Rails configuration
36
+ * user_method (required) - controller method to get user in application
37
+ * fluentd_enabled (optional) - enable sending logs to fluentd, default is true
38
+ * host (optional) - host to send fluentd logs, default is 127.0.0.1
39
+
33
40
  ## Development
34
41
 
35
42
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,3 +1,3 @@
1
1
  module TisoftLogging
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -5,16 +5,18 @@ require 'lograge'
5
5
  module TisoftLogging
6
6
  class Error < StandardError; end
7
7
 
8
- def self.setup(config:, user_method: :current_user)
8
+ def self.setup(config:, user_method: :current_user, host: '127.0.0.1', fluentd_enable: true)
9
9
  config.log_level = :info
10
- config.logger = ActFluentLoggerRails::Logger.
11
- new(settings: {
12
- host: '127.0.0.1',
13
- port: 24224,
14
- tag: "rails.#{Rails.application.class.parent_name.to_s.downcase}",
15
- messages_type: 'string',
16
- severity_key: 'INFO'
17
- })
10
+ if fluentd_enable
11
+ config.logger = ActFluentLoggerRails::Logger.
12
+ new(settings: {
13
+ host: host,
14
+ port: 24224,
15
+ tag: "rails.#{Rails.application.class.parent_name.to_s.downcase}",
16
+ messages_type: 'string',
17
+ severity_key: 'INFO'
18
+ })
19
+ end
18
20
  config.lograge.enabled = true
19
21
  config.lograge.formatter = Lograge::Formatters::Json.new
20
22
  config.lograge.custom_payload do |controller|
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Alexey Chernikov"]
10
10
  spec.email = ["alexey@chernikov.online"]
11
11
 
12
+ spec.licenses = ['MIT']
12
13
  spec.summary = %q{Configurate logging for Techinform Soft applications}
13
- spec.description = %q{Configurate logging for Techinform Soft applications}
14
+ spec.description = %q{Auto configure logging for Techinform Soft applications}
14
15
  spec.homepage = "https://techinform.dev"
15
16
 
16
17
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tisoft-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Chernikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: act-fluent-logger-rails
@@ -80,13 +80,14 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '5.0'
83
- description: Configurate logging for Techinform Soft applications
83
+ description: Auto configure logging for Techinform Soft applications
84
84
  email:
85
85
  - alexey@chernikov.online
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
+ - ".github/workflows/gempush.yml"
90
91
  - ".gitignore"
91
92
  - CODE_OF_CONDUCT.md
92
93
  - Gemfile
@@ -98,7 +99,8 @@ files:
98
99
  - lib/tisoft_logging/version.rb
99
100
  - tisoft_logging.gemspec
100
101
  homepage: https://techinform.dev
101
- licenses: []
102
+ licenses:
103
+ - MIT
102
104
  metadata:
103
105
  allowed_push_host: https://rubygems.org
104
106
  homepage_uri: https://techinform.dev
@@ -119,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  - !ruby/object:Gem::Version
120
122
  version: '0'
121
123
  requirements: []
122
- rubygems_version: 3.0.8
124
+ rubygems_version: 3.0.3
123
125
  signing_key:
124
126
  specification_version: 4
125
127
  summary: Configurate logging for Techinform Soft applications