semantic_logger 4.7.4 → 4.9.0
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/README.md +47 -19
 - data/lib/semantic_logger/appender/async.rb +1 -1
 - data/lib/semantic_logger/appender/elasticsearch.rb +24 -6
 - data/lib/semantic_logger/appender/file.rb +249 -68
 - data/lib/semantic_logger/appender/io.rb +68 -0
 - data/lib/semantic_logger/appender/kafka.rb +4 -0
 - data/lib/semantic_logger/appender/splunk.rb +2 -1
 - data/lib/semantic_logger/appender/splunk_http.rb +2 -2
 - data/lib/semantic_logger/appender/syslog.rb +5 -3
 - data/lib/semantic_logger/appender/wrapper.rb +3 -2
 - data/lib/semantic_logger/appender.rb +12 -6
 - data/lib/semantic_logger/appenders.rb +31 -27
 - data/lib/semantic_logger/base.rb +5 -4
 - data/lib/semantic_logger/formatters/base.rb +1 -0
 - data/lib/semantic_logger/formatters/color.rb +3 -3
 - data/lib/semantic_logger/formatters/logfmt.rb +72 -0
 - data/lib/semantic_logger/formatters/syslog.rb +2 -1
 - data/lib/semantic_logger/formatters/syslog_cee.rb +2 -1
 - data/lib/semantic_logger/formatters.rb +10 -11
 - data/lib/semantic_logger/log.rb +2 -4
 - data/lib/semantic_logger/loggable.rb +8 -1
 - data/lib/semantic_logger/logger.rb +16 -6
 - data/lib/semantic_logger/processor.rb +3 -3
 - data/lib/semantic_logger/semantic_logger.rb +18 -10
 - data/lib/semantic_logger/subscriber.rb +10 -0
 - data/lib/semantic_logger/sync_processor.rb +5 -5
 - data/lib/semantic_logger/test/capture_log_events.rb +34 -0
 - data/lib/semantic_logger/utils.rb +29 -10
 - data/lib/semantic_logger/version.rb +1 -1
 - data/lib/semantic_logger.rb +4 -0
 - metadata +8 -6
 
| 
         @@ -32,29 +32,48 @@ module SemanticLogger 
     | 
|
| 
       32 
32 
     | 
    
         
             
                  end
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                 
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
       37 
     | 
    
         
            -
                # Extract the backtrace leaving out the last few Semantic Logger lines.
         
     | 
| 
      
 35 
     | 
    
         
            +
                # Extract the backtrace stripping off the leading semantic logger entries.
         
     | 
| 
      
 36 
     | 
    
         
            +
                # Leaves all other system and gem path entries in place.
         
     | 
| 
       38 
37 
     | 
    
         
             
                def self.extract_backtrace(stack = caller)
         
     | 
| 
       39 
     | 
    
         
            -
                  while (first = stack.first) &&  
     | 
| 
      
 38 
     | 
    
         
            +
                  while (first = stack.first) && extract_path?(first)
         
     | 
| 
       40 
39 
     | 
    
         
             
                    stack.shift
         
     | 
| 
       41 
40 
     | 
    
         
             
                  end
         
     | 
| 
       42 
41 
     | 
    
         
             
                  stack
         
     | 
| 
       43 
42 
     | 
    
         
             
                end
         
     | 
| 
       44 
43 
     | 
    
         | 
| 
       45 
     | 
    
         
            -
                 
     | 
| 
      
 44 
     | 
    
         
            +
                def self.extract_paths
         
     | 
| 
      
 45 
     | 
    
         
            +
                  @extract_paths ||= %w[lib/semantic_logger lib/rails_semantic_logger]
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
                # Whether this path should be excluded from any cleansed backtrace
         
     | 
| 
      
 49 
     | 
    
         
            +
                def self.extract_path?(path)
         
     | 
| 
      
 50 
     | 
    
         
            +
                  extract_paths.any? { |exclude| path.include?(exclude) }
         
     | 
| 
      
 51 
     | 
    
         
            +
                end
         
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
                # Try to strip everything off of the supplied backtrace, until the first application stack entry is at the top.
         
     | 
| 
      
 54 
     | 
    
         
            +
                # For example all leading gem paths and built-in ruby code paths are removed from the top.
         
     | 
| 
      
 55 
     | 
    
         
            +
                # Once the first application entry is found, the remaining stack is returned.
         
     | 
| 
       46 
56 
     | 
    
         
             
                def self.strip_backtrace(stack = caller)
         
     | 
| 
       47 
     | 
    
         
            -
                  while (first = stack.first) &&  
     | 
| 
      
 57 
     | 
    
         
            +
                  while (first = stack.first) && (strip_path?(first) || extract_path?(first))
         
     | 
| 
       48 
58 
     | 
    
         
             
                    stack.shift
         
     | 
| 
       49 
59 
     | 
    
         
             
                  end
         
     | 
| 
       50 
60 
     | 
    
         
             
                  stack
         
     | 
| 
       51 
61 
     | 
    
         
             
                end
         
     | 
| 
       52 
62 
     | 
    
         | 
| 
       53 
     | 
    
         
            -
                 
     | 
| 
      
 63 
     | 
    
         
            +
                # Paths to exclude in the stripped backtrace
         
     | 
| 
      
 64 
     | 
    
         
            +
                # Includes Gems and built-in Ruby code paths
         
     | 
| 
      
 65 
     | 
    
         
            +
                def self.strip_paths
         
     | 
| 
      
 66 
     | 
    
         
            +
                  @strip_paths ||=
         
     | 
| 
      
 67 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 68 
     | 
    
         
            +
                      paths = Gem.path | [Gem.default_dir]
         
     | 
| 
      
 69 
     | 
    
         
            +
                      paths << RbConfig::CONFIG["rubylibdir"]
         
     | 
| 
      
 70 
     | 
    
         
            +
                      paths
         
     | 
| 
      
 71 
     | 
    
         
            +
                    end
         
     | 
| 
      
 72 
     | 
    
         
            +
                end
         
     | 
| 
       54 
73 
     | 
    
         | 
| 
       55 
     | 
    
         
            -
                 
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
      
 74 
     | 
    
         
            +
                # Whether this path should be excluded from any cleansed backtrace
         
     | 
| 
      
 75 
     | 
    
         
            +
                def self.strip_path?(path)
         
     | 
| 
      
 76 
     | 
    
         
            +
                  strip_paths.any? { |exclude| path.start_with?(exclude) }
         
     | 
| 
       58 
77 
     | 
    
         
             
                end
         
     | 
| 
       59 
78 
     | 
    
         
             
              end
         
     | 
| 
       60 
79 
     | 
    
         
             
            end
         
     | 
    
        data/lib/semantic_logger.rb
    CHANGED
    
    | 
         @@ -32,6 +32,10 @@ module SemanticLogger 
     | 
|
| 
       32 
32 
     | 
    
         
             
                autoload :Minitest,          "semantic_logger/reporters/minitest"
         
     | 
| 
       33 
33 
     | 
    
         
             
              end
         
     | 
| 
       34 
34 
     | 
    
         | 
| 
      
 35 
     | 
    
         
            +
              module Test
         
     | 
| 
      
 36 
     | 
    
         
            +
                autoload :CaptureLogEvents,  "semantic_logger/test/capture_log_events"
         
     | 
| 
      
 37 
     | 
    
         
            +
              end
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
       35 
39 
     | 
    
         
             
              if defined?(JRuby)
         
     | 
| 
       36 
40 
     | 
    
         
             
                module JRuby
         
     | 
| 
       37 
41 
     | 
    
         
             
                  autoload :GarbageCollectionLogger, "semantic_logger/jruby/garbage_collection_logger"
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: semantic_logger
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 4. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.9.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Reid Morrison
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-12-28 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: concurrent-ruby
         
     | 
| 
         @@ -26,7 +26,6 @@ dependencies: 
     | 
|
| 
       26 
26 
     | 
    
         
             
                    version: '1.0'
         
     | 
| 
       27 
27 
     | 
    
         
             
            description:
         
     | 
| 
       28 
28 
     | 
    
         
             
            email:
         
     | 
| 
       29 
     | 
    
         
            -
            - reidmo@gmail.com
         
     | 
| 
       30 
29 
     | 
    
         
             
            executables: []
         
     | 
| 
       31 
30 
     | 
    
         
             
            extensions: []
         
     | 
| 
       32 
31 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
         @@ -46,6 +45,7 @@ files: 
     | 
|
| 
       46 
45 
     | 
    
         
             
            - lib/semantic_logger/appender/graylog.rb
         
     | 
| 
       47 
46 
     | 
    
         
             
            - lib/semantic_logger/appender/honeybadger.rb
         
     | 
| 
       48 
47 
     | 
    
         
             
            - lib/semantic_logger/appender/http.rb
         
     | 
| 
      
 48 
     | 
    
         
            +
            - lib/semantic_logger/appender/io.rb
         
     | 
| 
       49 
49 
     | 
    
         
             
            - lib/semantic_logger/appender/kafka.rb
         
     | 
| 
       50 
50 
     | 
    
         
             
            - lib/semantic_logger/appender/mongodb.rb
         
     | 
| 
       51 
51 
     | 
    
         
             
            - lib/semantic_logger/appender/new_relic.rb
         
     | 
| 
         @@ -68,6 +68,7 @@ files: 
     | 
|
| 
       68 
68 
     | 
    
         
             
            - lib/semantic_logger/formatters/default.rb
         
     | 
| 
       69 
69 
     | 
    
         
             
            - lib/semantic_logger/formatters/fluentd.rb
         
     | 
| 
       70 
70 
     | 
    
         
             
            - lib/semantic_logger/formatters/json.rb
         
     | 
| 
      
 71 
     | 
    
         
            +
            - lib/semantic_logger/formatters/logfmt.rb
         
     | 
| 
       71 
72 
     | 
    
         
             
            - lib/semantic_logger/formatters/one_line.rb
         
     | 
| 
       72 
73 
     | 
    
         
             
            - lib/semantic_logger/formatters/raw.rb
         
     | 
| 
       73 
74 
     | 
    
         
             
            - lib/semantic_logger/formatters/signalfx.rb
         
     | 
| 
         @@ -87,9 +88,10 @@ files: 
     | 
|
| 
       87 
88 
     | 
    
         
             
            - lib/semantic_logger/subscriber.rb
         
     | 
| 
       88 
89 
     | 
    
         
             
            - lib/semantic_logger/sync.rb
         
     | 
| 
       89 
90 
     | 
    
         
             
            - lib/semantic_logger/sync_processor.rb
         
     | 
| 
      
 91 
     | 
    
         
            +
            - lib/semantic_logger/test/capture_log_events.rb
         
     | 
| 
       90 
92 
     | 
    
         
             
            - lib/semantic_logger/utils.rb
         
     | 
| 
       91 
93 
     | 
    
         
             
            - lib/semantic_logger/version.rb
         
     | 
| 
       92 
     | 
    
         
            -
            homepage: https:// 
     | 
| 
      
 94 
     | 
    
         
            +
            homepage: https://logger.rocketjob.io
         
     | 
| 
       93 
95 
     | 
    
         
             
            licenses:
         
     | 
| 
       94 
96 
     | 
    
         
             
            - Apache-2.0
         
     | 
| 
       95 
97 
     | 
    
         
             
            metadata: {}
         
     | 
| 
         @@ -101,14 +103,14 @@ required_ruby_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       101 
103 
     | 
    
         
             
              requirements:
         
     | 
| 
       102 
104 
     | 
    
         
             
              - - ">="
         
     | 
| 
       103 
105 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       104 
     | 
    
         
            -
                  version: '2. 
     | 
| 
      
 106 
     | 
    
         
            +
                  version: '2.5'
         
     | 
| 
       105 
107 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       106 
108 
     | 
    
         
             
              requirements:
         
     | 
| 
       107 
109 
     | 
    
         
             
              - - ">="
         
     | 
| 
       108 
110 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       109 
111 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       110 
112 
     | 
    
         
             
            requirements: []
         
     | 
| 
       111 
     | 
    
         
            -
            rubygems_version: 3. 
     | 
| 
      
 113 
     | 
    
         
            +
            rubygems_version: 3.0.9
         
     | 
| 
       112 
114 
     | 
    
         
             
            signing_key:
         
     | 
| 
       113 
115 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       114 
116 
     | 
    
         
             
            summary: Feature rich logging framework, and replacement for existing Ruby & Rails
         
     |