legion-logging 1.2.0 → 1.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21a5261aeaf452af982b77873dd0733cf16b38f874ba7dc67726b0abba933712
4
- data.tar.gz: 1e8e922c206fa4e4c216147c00583628fc6743f1c94021d45855f0109db14cdc
3
+ metadata.gz: ee94bdf6225742609903f1e3e6c138ee5cbd5997fe1d6558591d250a1f53f2d0
4
+ data.tar.gz: 0754c9ff2994dbda182550fb390f9462a6368915bdd2b037d2c8896c825e8199
5
5
  SHA512:
6
- metadata.gz: f05d6e02d5348f9e942f0c32c6e08706d16f0d06f2d59fee636ab76a7ff1c32b646a265b8365ad8e721c857ddfb80cd94d6b29f91554f0afe7d4dc1ed5804d80
7
- data.tar.gz: afc20f2c2ce8b084136e423f88003b821ff6d78f7c76a9482885500344282c02e4ed1d20a67b164ec2fa87804e5d62c29a03de9b87d0090014c32fcc9541e2e2
6
+ metadata.gz: 3097a20b5e2ef0bdf3c7075bb3102daf6ab66e2a635f96aa62b0792538e6fd0ae627188e432b73acbc58da2032e0fd68d380a6b0d04a0d1d8b5e0fff8854d13d
7
+ data.tar.gz: 133b1f37a5fc9ba6ba90944356e0232428815034b99c9c026ee9cdd79769bd053c592d8b57295a67cbc2b5b40e1f3c449c8d15b52e08fc4880296dcd09dc72df
@@ -0,0 +1,16 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ pull_request:
6
+
7
+ jobs:
8
+ ci:
9
+ uses: LegionIO/.github/.github/workflows/ci.yml@main
10
+
11
+ release:
12
+ needs: ci
13
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
14
+ uses: LegionIO/.github/.github/workflows/release.yml@main
15
+ secrets:
16
+ rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
data/.rubocop.yml CHANGED
@@ -1,20 +1,50 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.4
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+
1
6
  Layout/LineLength:
2
- Max: 120
7
+ Max: 160
8
+
9
+ Layout/SpaceAroundEqualsInParameterDefault:
10
+ EnforcedStyle: space
11
+
12
+ Layout/HashAlignment:
13
+ EnforcedHashRocketStyle: table
14
+ EnforcedColonStyle: table
15
+
3
16
  Metrics/MethodLength:
4
- Max: 30
17
+ Max: 50
18
+
5
19
  Metrics/ClassLength:
6
20
  Max: 1500
21
+
22
+ Metrics/ModuleLength:
23
+ Max: 1500
24
+
7
25
  Metrics/BlockLength:
8
- Max: 75
26
+ Max: 40
27
+ Exclude:
28
+ - 'spec/**/*'
29
+
30
+ Metrics/AbcSize:
31
+ Max: 60
32
+
9
33
  Metrics/CyclomaticComplexity:
10
- Max: 9
34
+ Max: 15
35
+
36
+ Metrics/PerceivedComplexity:
37
+ Max: 17
38
+
11
39
  Style/Documentation:
12
40
  Enabled: false
13
- AllCops:
14
- TargetRubyVersion: 2.6
15
- NewCops: enable
16
- SuggestExtensions: false
41
+
42
+ Style/SymbolArray:
43
+ Enabled: true
44
+
17
45
  Style/FrozenStringLiteralComment:
18
- Enabled: false
19
- Gemspec/RequiredRubyVersion:
46
+ Enabled: true
47
+ EnforcedStyle: always
48
+
49
+ Naming/FileName:
20
50
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,4 +1,11 @@
1
1
  # Legion::Logging Changelog
2
2
 
3
+ ## v1.2.2
4
+
5
+ ### Added
6
+ - `Legion::Logging::SIEMExporter`: Splunk HEC and ELK log shipping with PHI/PII redaction
7
+ - `redact_phi` strips SSN, phone, MRN, and DOB patterns from log text
8
+ - `format_for_elk` produces ELK-compatible event hashes
9
+
3
10
  ## v1.2.0
4
- Moving from BitBucket to GitHub inside the Optum org. All git history is reset from this point on
11
+ Moving from BitBucket to GitHub. All git history is reset from this point on
data/CLAUDE.md ADDED
@@ -0,0 +1,54 @@
1
+ # legion-logging: Logging Framework for LegionIO
2
+
3
+ **Repository Level 3 Documentation**
4
+ - **Parent**: `/Users/miverso2/rubymine/legion/CLAUDE.md`
5
+
6
+ ## Purpose
7
+
8
+ Ruby logging class for the LegionIO framework. Provides colorized console output via Rainbow, structured JSON logging (`format: :json`), and a consistent logging interface across all Legion gems and extensions.
9
+
10
+ **GitHub**: https://github.com/LegionIO/legion-logging
11
+ **License**: Apache-2.0
12
+
13
+ ## Architecture
14
+
15
+ ```
16
+ Legion::Logging (singleton module)
17
+ ├── Methods # Log level methods: debug, info, warn, error, fatal, unknown
18
+ ├── Builder # Output destination (stdout/file), log level, formatter
19
+ ├── Logger # Core logger configuration and setup
20
+ └── Version # VERSION constant
21
+ ```
22
+
23
+ ### Key Design Patterns
24
+
25
+ - **Singleton Module**: `Legion::Logging` uses `class << self` - called directly: `Legion::Logging.info("msg")`
26
+ - **Rainbow Colorization**: Console output uses Rainbow gem for colored terminal output
27
+ - **Setup Method**: `Legion::Logging.setup(log_file:, level:)` configures output destination and level
28
+ - **Structured JSON**: `format: :json` in settings outputs machine-parseable JSON log lines
29
+ - **Shared Interface**: Same method signature (`info`, `warn`, `error`, etc.) across all Legion components
30
+
31
+ ## Dependencies
32
+
33
+ | Gem | Purpose |
34
+ |-----|---------|
35
+ | `rainbow` (~> 3) | Terminal colorization |
36
+
37
+ ## File Map
38
+
39
+ | Path | Purpose |
40
+ |------|---------|
41
+ | `lib/legion/logging.rb` | Module entry point |
42
+ | `lib/legion/logging/methods.rb` | Log level methods |
43
+ | `lib/legion/logging/builder.rb` | Output config and formatter |
44
+ | `lib/legion/logging/logger.rb` | Core logger setup |
45
+ | `lib/legion/logging/multi_io.rb` | Multi-output IO (write to multiple destinations simultaneously) |
46
+ | `lib/legion/logging/version.rb` | VERSION constant |
47
+
48
+ ## Role in LegionIO
49
+
50
+ **Foundational gem** - used by `legion-cache`, `legion-data`, and `LegionIO` as a direct dependency. First module initialized during `Legion::Service` startup.
51
+
52
+ ---
53
+
54
+ **Maintained By**: Matthew Iverson (@Esity)
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/LICENSE CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2021 Optum
189
+ Copyright 2021 Esity
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
data/README.md CHANGED
@@ -1,40 +1,48 @@
1
- Legion::Logging
2
- =====
1
+ # legion-logging
3
2
 
4
- Legion::Logging is a ruby logging class that is used by the LegionIO framework. It gives all other gems and extensions a
5
- single logging library to use for consistency.
3
+ Logging module for the [LegionIO](https://github.com/LegionIO/LegionIO) framework. Provides colorized console output via Rainbow and a consistent logging interface across all Legion gems and extensions.
6
4
 
7
- Supported Ruby versions and implementations
8
- ------------------------------------------------
9
-
10
- Legion::Json should work identically on:
11
-
12
- * JRuby 9.2+
13
- * Ruby 2.4+
14
-
15
-
16
- Installation and Usage
17
- ------------------------
18
-
19
- You can verify your installation using this piece of code:
5
+ ## Installation
20
6
 
21
7
  ```bash
22
8
  gem install legion-logging
23
9
  ```
24
10
 
11
+ Or add to your Gemfile:
12
+
13
+ ```ruby
14
+ gem 'legion-logging'
15
+ ```
16
+
17
+ ## Usage
18
+
25
19
  ```ruby
26
- require 'legion-logging'
20
+ require 'legion/logging'
27
21
 
28
22
  Legion::Logging.setup(log_file: './legion.log', level: 'debug')
29
- Legion::Logging.setup(level: 'info0') # defaults to stdout when no log_file specified
23
+ Legion::Logging.setup(level: 'info') # defaults to stdout when no log_file specified
30
24
 
31
- Legion::Logging.warn('warning a user')
25
+ Legion::Logging.debug('debugging info')
32
26
  Legion::Logging.info('hello')
27
+ Legion::Logging.warn('warning a user')
28
+ Legion::Logging.error('something went wrong')
29
+ Legion::Logging.fatal('critical failure')
30
+ ```
31
+
32
+ ### Structured JSON Output
33
33
 
34
+ Pass `format: :json` to disable colorization and emit machine-parseable JSON log lines:
34
35
 
36
+ ```ruby
37
+ Legion::Logging.setup(level: 'info', format: :json)
35
38
  ```
36
39
 
37
- Authors
38
- ----------
40
+ This is useful for log aggregation pipelines (Elasticsearch, Splunk, etc.).
41
+
42
+ ## Requirements
43
+
44
+ - Ruby >= 3.4
45
+
46
+ ## License
39
47
 
40
- * [Matthew Iverson](https://github.com/Esity) - current maintainer
48
+ Apache-2.0
@@ -6,24 +6,24 @@ Gem::Specification.new do |spec|
6
6
  spec.name = 'legion-logging'
7
7
  spec.version = Legion::Logging::VERSION
8
8
  spec.authors = ['Esity']
9
- spec.email = %w[matthewdiverson@gmail.com ruby@optum.com]
9
+ spec.email = ['matthewdiverson@gmail.com']
10
10
 
11
11
  spec.summary = 'The logging class that the LegionIO framework uses'
12
12
  spec.description = 'A logging class used by the LegionIO framework'
13
- spec.homepage = 'https://github.com/Optum/legion-logging'
13
+ spec.homepage = 'https://github.com/LegionIO/legion-logging'
14
14
  spec.license = 'Apache-2.0'
15
15
  spec.require_paths = ['lib']
16
- spec.required_ruby_version = '>= 2.5'
16
+ spec.required_ruby_version = '>= 3.4'
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
- spec.test_files = spec.files.select { |p| p =~ %r{^test/.*_test.rb} }
19
- spec.extra_rdoc_files = %w[README.md LICENSE CHANGELOG.md]
18
+ spec.extra_rdoc_files = %w[README.md LICENSE CHANGELOG.md]
20
19
  spec.metadata = {
21
- 'bug_tracker_uri' => 'https://github.com/Optum/legion-logging/issues',
22
- 'changelog_uri' => 'https://github.com/Optum/legion-logging/src/main/CHANGELOG.md',
23
- 'documentation_uri' => 'https://github.com/Optum/legion-logging',
24
- 'homepage_uri' => 'https://github.com/Optum/LegionIO',
25
- 'source_code_uri' => 'https://github.com/Optum/legion-logging',
26
- 'wiki_uri' => 'https://github.com/Optum/legion-logging/wiki'
20
+ 'bug_tracker_uri' => 'https://github.com/LegionIO/legion-logging/issues',
21
+ 'changelog_uri' => 'https://github.com/LegionIO/legion-logging/blob/main/CHANGELOG.md',
22
+ 'documentation_uri' => 'https://github.com/LegionIO/legion-logging',
23
+ 'homepage_uri' => 'https://github.com/LegionIO/LegionIO',
24
+ 'source_code_uri' => 'https://github.com/LegionIO/legion-logging',
25
+ 'wiki_uri' => 'https://github.com/LegionIO/legion-logging/wiki',
26
+ 'rubygems_mfa_required' => 'true'
27
27
  }
28
28
 
29
29
  spec.add_dependency 'rainbow', '~> 3'
@@ -1,23 +1,54 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Logging
3
5
  module Builder
4
- def log_format(include_pid: false, **options) # rubocop:disable Metrics/AbcSize
6
+ def log_format(format: :text, include_pid: false, **)
7
+ @format = format.to_sym
8
+ if @format == :json
9
+ json_format(include_pid: include_pid)
10
+ else
11
+ text_format(include_pid: include_pid, **)
12
+ end
13
+ end
14
+
15
+ def json?
16
+ @format == :json
17
+ end
18
+
19
+ def json_format(include_pid: false)
20
+ log.formatter = proc do |severity, datetime, _progname, msg|
21
+ entry = {
22
+ timestamp: datetime.utc.iso8601(3),
23
+ level: severity.downcase,
24
+ message: msg.is_a?(String) ? msg.gsub(/\e\[[0-9;]*m/, '') : msg.to_s,
25
+ thread: Thread.current.object_id
26
+ }
27
+ entry[:pid] = ::Process.pid if include_pid
28
+ "#{::JSON.generate(entry)}\n"
29
+ rescue StandardError
30
+ "{\"timestamp\":\"#{datetime}\",\"level\":\"#{severity}\",\"message\":#{msg.to_s.dump}}\n"
31
+ end
32
+ end
33
+
34
+ def text_format(include_pid: false, **options)
5
35
  log.formatter = proc do |severity, datetime, _progname, msg|
6
36
  options[:lex_name] = options.key?(:lex) ? "[#{options[:lex]}]" : nil
7
37
  unless options[:lex_name].nil?
8
- data = caller_locations[4].to_s.split('/').last(2)
38
+ loc = caller_locations[4]
39
+ path = loc.to_s.split('/').last(2)
9
40
  runner_trace = {
10
- type: data[0],
11
- file: data[1].split('.')[0],
12
- function: data[1].split('`')[1].delete_suffix('\''),
13
- line_number: data[1].split(':')[1]
41
+ type: path[0],
42
+ file: File.basename(loc.path, '.*'),
43
+ function: loc.base_label,
44
+ line_number: loc.lineno
14
45
  }
15
46
  end
16
47
  string = "[#{datetime}]"
17
48
  string.concat("[#{::Process.pid}]") if include_pid
18
49
  string.concat(options[:lex_name]) unless options[:lex_name].nil?
19
50
  if runner_trace.is_a?(Hash) && (options[:extended] || severity == 'debug')
20
- string.concat("[#{runner_trace[:type]}:#{runner_trace[:file]}:#{runner_trace[:function]}:#{runner_trace[:line_number]}]") # rubocop:disable Layout/LineLength
51
+ string.concat("[#{runner_trace[:type]}:#{runner_trace[:file]}:#{runner_trace[:function]}:#{runner_trace[:line_number]}]")
21
52
  end
22
53
  string.concat(" #{severity} #{msg}\n")
23
54
  string
@@ -25,16 +56,31 @@ module Legion
25
56
  end
26
57
 
27
58
  def output(**options)
28
- @log = ::Logger.new($stdout) if options[:log_file].nil?
29
- @log = ::Logger.new(options[:log_file]) unless options[:log_file].nil?
59
+ if options[:log_file] && options[:log_stdout] != false
60
+ require_relative 'multi_io'
61
+ io = MultiIO.new($stdout, File.open(options[:log_file], 'a'))
62
+ @log = ::Logger.new(io)
63
+ elsif options[:log_file]
64
+ @log = ::Logger.new(options[:log_file])
65
+ else
66
+ @log = ::Logger.new($stdout)
67
+ end
30
68
  end
31
69
 
32
70
  def log
33
71
  @log ||= set_log
34
72
  end
35
73
 
36
- def set_log(logfile: nil, **)
37
- @log = logfile.nil? ? ::Logger.new($stdout) : ::Logger.new(logfile)
74
+ def set_log(logfile: nil, log_stdout: nil, **)
75
+ if logfile && log_stdout != false
76
+ require_relative 'multi_io'
77
+ io = MultiIO.new($stdout, File.open(logfile, 'a'))
78
+ @log = ::Logger.new(io)
79
+ elsif logfile
80
+ @log = ::Logger.new(logfile)
81
+ else
82
+ @log = ::Logger.new($stdout)
83
+ end
38
84
  end
39
85
 
40
86
  def level
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'legion/logging/methods'
2
4
  require 'legion/logging/builder'
3
5
 
@@ -9,12 +11,12 @@ module Legion
9
11
  include Legion::Logging::Methods
10
12
  include Legion::Logging::Builder
11
13
 
12
- def initialize(level: 'info', log_file: nil, lex: nil, trace: false, extended: false, trace_size: 4, **opts) # rubocop:disable Metrics/ParameterLists
13
- set_log(logfile: log_file)
14
+ def initialize(level: 'info', log_file: nil, log_stdout: nil, lex: nil, trace: false, extended: false, trace_size: 4, format: :text, **opts) # rubocop:disable Metrics/ParameterLists
15
+ set_log(logfile: log_file, log_stdout: log_stdout)
14
16
  log_level(level)
15
- log_format(lex: lex, extended: extended, **opts)
17
+ log_format(format: format, lex: lex, extended: extended, **opts)
16
18
  @color = opts[:color]
17
- @color = true if opts[:color].nil? && log_file.nil?
19
+ @color = format != :json && (opts[:color] || (opts[:color].nil? && log_file.nil?))
18
20
  @trace_enabled = trace
19
21
  @trace_size = trace_size
20
22
  @extended = extended
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Logging
3
5
  module Methods
4
- def trace(raw_message = nil, size: @trace_size, log_caller: true) # rubocop:disable Metrics/AbcSize
6
+ def trace(raw_message = nil, size: @trace_size, log_caller: true)
5
7
  return unless @trace_enabled
6
8
 
7
9
  raw_message = yield if raw_message.nil? && block_given?
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Legion
4
+ module Logging
5
+ class MultiIO
6
+ def initialize(*targets)
7
+ @targets = targets.flatten
8
+ end
9
+
10
+ def write(message)
11
+ @targets.each do |t|
12
+ t.write(message)
13
+ t.flush if t.respond_to?(:flush)
14
+ end
15
+ end
16
+
17
+ def close
18
+ @targets.each { |t| t.close unless [$stdout, $stderr].include?(t) }
19
+ end
20
+
21
+ def flush
22
+ @targets.each { |t| t.flush if t.respond_to?(:flush) }
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+ require 'net/http'
5
+ require 'uri'
6
+
7
+ module Legion
8
+ module Logging
9
+ module SIEMExporter
10
+ PHI_PATTERNS = [
11
+ [/\b\d{3}-\d{2}-\d{4}\b/, '[SSN-REDACTED]'],
12
+ [/\b\d{3}-\d{3}-\d{4}\b/, '[PHONE-REDACTED]'],
13
+ [/\b[A-Z]{2}\d{7}\b/, '[MRN-REDACTED]'],
14
+ [%r{\b\d{2}/\d{2}/\d{4}\b}, '[DOB-REDACTED]']
15
+ ].freeze
16
+
17
+ class << self
18
+ def redact_phi(text)
19
+ result = text.to_s.dup
20
+ PHI_PATTERNS.each { |pattern, replacement| result.gsub!(pattern, replacement) }
21
+ result
22
+ end
23
+
24
+ def export_to_splunk(event, hec_url:, token:)
25
+ uri = URI(hec_url)
26
+ req = Net::HTTP::Post.new(uri)
27
+ req['Authorization'] = "Splunk #{token}"
28
+ req['Content-Type'] = 'application/json'
29
+ req.body = ::JSON.dump({ event: redact_phi(event.to_s), time: Time.now.to_f })
30
+
31
+ Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
32
+ http.request(req)
33
+ end
34
+ rescue StandardError => e
35
+ { error: e.message }
36
+ end
37
+
38
+ def format_for_elk(event, index: 'legion')
39
+ {
40
+ '@timestamp' => Time.now.utc.iso8601,
41
+ 'index' => index,
42
+ 'message' => redact_phi(event.to_s),
43
+ 'source' => 'legion'
44
+ }
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Legion
2
4
  module Logging
3
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.2.2'
4
6
  end
5
7
  end
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'legion/logging/version'
2
4
  require 'legion/logging/logger'
3
5
  require 'legion/logging/methods'
4
6
  require 'legion/logging/builder'
5
7
 
8
+ require 'json'
6
9
  require 'logger'
7
10
  require 'rainbow'
8
11
 
@@ -11,14 +14,15 @@ module Legion
11
14
  class << self
12
15
  include Legion::Logging::Methods
13
16
  include Legion::Logging::Builder
17
+
14
18
  attr_reader :color
15
19
 
16
- def setup(level: 'info', **options)
20
+ def setup(level: 'info', format: :text, **options)
17
21
  output(**options)
18
22
  log_level(level)
19
- log_format(**options)
23
+ log_format(format: format, **options)
20
24
  @color = options[:color]
21
- @color = true if options[:color].nil? && options[:log_file].nil?
25
+ @color = format != :json && (options[:color] || (options[:color].nil? && options[:log_file].nil?))
22
26
  end
23
27
  end
24
28
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legion-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esity
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-06-08 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rainbow
@@ -27,48 +26,41 @@ dependencies:
27
26
  description: A logging class used by the LegionIO framework
28
27
  email:
29
28
  - matthewdiverson@gmail.com
30
- - ruby@optum.com
31
29
  executables: []
32
30
  extensions: []
33
31
  extra_rdoc_files:
34
- - README.md
35
- - LICENSE
36
32
  - CHANGELOG.md
33
+ - LICENSE
34
+ - README.md
37
35
  files:
38
- - ".github/workflows/rspec.yml"
39
- - ".github/workflows/rubocop-analysis.yml"
40
- - ".github/workflows/sourcehawk-scan.yml"
36
+ - ".github/workflows/ci.yml"
41
37
  - ".gitignore"
42
38
  - ".rubocop.yml"
43
39
  - CHANGELOG.md
44
- - CODE_OF_CONDUCT.md
45
- - CONTRIBUTING.md
40
+ - CLAUDE.md
46
41
  - Gemfile
47
- - INDIVIDUAL_CONTRIBUTOR_LICENSE.md
48
42
  - LICENSE
49
- - NOTICE.txt
50
43
  - README.md
51
- - SECURITY.md
52
- - attribution.txt
53
44
  - legion-logging.gemspec
54
45
  - lib/legion/logging.rb
55
46
  - lib/legion/logging/builder.rb
56
47
  - lib/legion/logging/logger.rb
57
48
  - lib/legion/logging/methods.rb
49
+ - lib/legion/logging/multi_io.rb
50
+ - lib/legion/logging/siem_exporter.rb
58
51
  - lib/legion/logging/version.rb
59
52
  - sonar-project.properties
60
- - sourcehawk.yml
61
- homepage: https://github.com/Optum/legion-logging
53
+ homepage: https://github.com/LegionIO/legion-logging
62
54
  licenses:
63
55
  - Apache-2.0
64
56
  metadata:
65
- bug_tracker_uri: https://github.com/Optum/legion-logging/issues
66
- changelog_uri: https://github.com/Optum/legion-logging/src/main/CHANGELOG.md
67
- documentation_uri: https://github.com/Optum/legion-logging
68
- homepage_uri: https://github.com/Optum/LegionIO
69
- source_code_uri: https://github.com/Optum/legion-logging
70
- wiki_uri: https://github.com/Optum/legion-logging/wiki
71
- post_install_message:
57
+ bug_tracker_uri: https://github.com/LegionIO/legion-logging/issues
58
+ changelog_uri: https://github.com/LegionIO/legion-logging/blob/main/CHANGELOG.md
59
+ documentation_uri: https://github.com/LegionIO/legion-logging
60
+ homepage_uri: https://github.com/LegionIO/LegionIO
61
+ source_code_uri: https://github.com/LegionIO/legion-logging
62
+ wiki_uri: https://github.com/LegionIO/legion-logging/wiki
63
+ rubygems_mfa_required: 'true'
72
64
  rdoc_options: []
73
65
  require_paths:
74
66
  - lib
@@ -76,15 +68,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
68
  requirements:
77
69
  - - ">="
78
70
  - !ruby/object:Gem::Version
79
- version: '2.5'
71
+ version: '3.4'
80
72
  required_rubygems_version: !ruby/object:Gem::Requirement
81
73
  requirements:
82
74
  - - ">="
83
75
  - !ruby/object:Gem::Version
84
76
  version: '0'
85
77
  requirements: []
86
- rubygems_version: 3.1.6
87
- signing_key:
78
+ rubygems_version: 3.6.9
88
79
  specification_version: 4
89
80
  summary: The logging class that the LegionIO framework uses
90
81
  test_files: []
@@ -1,69 +0,0 @@
1
- name: RSpec
2
- on: [push, pull_request]
3
-
4
- jobs:
5
- rspec:
6
- strategy:
7
- fail-fast: false
8
- matrix:
9
- os: [ubuntu-latest]
10
- ruby: [2.7]
11
- runs-on: ${{ matrix.os }}
12
- steps:
13
- - uses: actions/checkout@v2
14
- - uses: ruby/setup-ruby@v1
15
- with:
16
- ruby-version: ${{ matrix.ruby }}
17
- bundler-cache: true
18
- - name: RSpec run
19
- run: |
20
- bash -c "
21
- bundle exec rspec
22
- [[ $? -ne 2 ]]
23
- "
24
- rspec-mri:
25
- needs: rspec
26
- strategy:
27
- fail-fast: false
28
- matrix:
29
- os: [ ubuntu-latest ]
30
- ruby: [2.5, 2.6, '3.0', head]
31
- runs-on: ${{ matrix.os }}
32
- steps:
33
- - uses: actions/checkout@v2
34
- - uses: ruby/setup-ruby@v1
35
- with:
36
- ruby-version: ${{ matrix.ruby }}
37
- bundler-cache: true
38
- - run: bundle exec rspec
39
- rspec-jruby:
40
- needs: rspec
41
- strategy:
42
- fail-fast: false
43
- matrix:
44
- os: [ ubuntu-latest ]
45
- ruby: [ jruby, jruby-head]
46
- runs-on: ${{ matrix.os }}
47
- steps:
48
- - uses: actions/checkout@v2
49
- - uses: ruby/setup-ruby@v1
50
- with:
51
- ruby-version: ${{ matrix.ruby }}
52
- bundler-cache: true
53
- - run: JRUBY_OPTS="--debug" bundle exec rspec
54
- rspec-truffleruby:
55
- needs: rspec
56
- strategy:
57
- fail-fast: false
58
- matrix:
59
- os: [ ubuntu-latest ]
60
- ruby: [truffleruby]
61
- runs-on: ${{ matrix.os }}
62
- steps:
63
- - uses: actions/checkout@v2
64
- - uses: ruby/setup-ruby@v1
65
- with:
66
- ruby-version: ${{ matrix.ruby }}
67
- bundler-cache: true
68
- - run: bundle exec rspec
69
-
@@ -1,28 +0,0 @@
1
- name: Rubocop
2
- on: [push, pull_request]
3
- jobs:
4
- rubocop:
5
- strategy:
6
- fail-fast: false
7
- matrix:
8
- os: [ubuntu-latest]
9
- ruby: [2.7]
10
- runs-on: ${{ matrix.os }}
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: ruby/setup-ruby@v1
14
- with:
15
- ruby-version: ${{ matrix.ruby }}
16
- bundler-cache: true
17
- - name: Install Rubocop
18
- run: gem install rubocop code-scanning-rubocop
19
- - name: Rubocop run --no-doc
20
- run: |
21
- bash -c "
22
- rubocop --require code_scanning --format CodeScanning::SarifFormatter -o rubocop.sarif
23
- [[ $? -ne 2 ]]
24
- "
25
- - name: Upload Sarif output
26
- uses: github/codeql-action/upload-sarif@v1
27
- with:
28
- sarif_file: rubocop.sarif
@@ -1,20 +0,0 @@
1
- name: Sourcehawk Scan
2
- on:
3
- push:
4
- branches:
5
- - main
6
- - master
7
- pull_request:
8
- branches:
9
- - main
10
- - master
11
- jobs:
12
- build:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v2
16
- - name: Sourcehawk Scan
17
- uses: optum/sourcehawk-scan-github-action@main
18
-
19
-
20
-
data/CODE_OF_CONDUCT.md DELETED
@@ -1,75 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project email
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at [opensource@optum.com][email]. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
75
- [email]: mailto:opensource@optum.com
data/CONTRIBUTING.md DELETED
@@ -1,55 +0,0 @@
1
- # Contribution Guidelines
2
-
3
- Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms. Please also review our [Contributor License Agreement ("CLA")](INDIVIDUAL_CONTRIBUTOR_LICENSE.md) prior to submitting changes to the project. You will need to attest to this agreement following the instructions in the [Paperwork for Pull Requests](#paperwork-for-pull-requests) section below.
4
-
5
- ---
6
-
7
- # How to Contribute
8
-
9
- Now that we have the disclaimer out of the way, let's get into how you can be a part of our project. There are many different ways to contribute.
10
-
11
- ## Issues
12
-
13
- We track our work using Issues in GitHub. Feel free to open up your own issue to point out areas for improvement or to suggest your own new experiment. If you are comfortable with signing the waiver linked above and contributing code or documentation, grab your own issue and start working.
14
-
15
- ## Coding Standards
16
-
17
- We have some general guidelines towards contributing to this project.
18
- Please run RSpec and Rubocop while developing code for LegionIO
19
-
20
- ### Languages
21
-
22
- *Ruby*
23
-
24
- ## Pull Requests
25
-
26
- If you've gotten as far as reading this section, then thank you for your suggestions.
27
-
28
- ## Paperwork for Pull Requests
29
-
30
- * Please read this guide and make sure you agree with our [Contributor License Agreement ("CLA")](INDIVIDUAL_CONTRIBUTOR_LICENSE.md).
31
- * Make sure git knows your name and email address:
32
- ```
33
- $ git config user.name "J. Random User"
34
- $ git config user.email "j.random.user@example.com"
35
- ```
36
- >The name and email address must be valid as we cannot accept anonymous contributions.
37
- * Write good commit messages.
38
- > Concise commit messages that describe your changes help us better understand your contributions.
39
- * The first time you open a pull request in this repository, you will see a comment on your PR with a link that will allow you to sign our Contributor License Agreement (CLA) if necessary.
40
- > The link will take you to a page that allows you to view our CLA. You will need to click the `Sign in with GitHub to agree button` and authorize the cla-assistant application to access the email addresses associated with your GitHub account. Agreeing to the CLA is also considered to be an attestation that you either wrote or have the rights to contribute the code. All committers to the PR branch will be required to sign the CLA, but you will only need to sign once. This CLA applies to all repositories in the Optum org.
41
-
42
- ## General Guidelines
43
-
44
- Ensure your pull request (PR) adheres to the following guidelines:
45
-
46
- * Try to make the name concise and descriptive.
47
- * Give a good description of the change being made. Since this is very subjective, see the [Updating Your Pull Request (PR)](#updating-your-pull-request-pr) section below for further details.
48
- * Every pull request should be associated with one or more issues. If no issue exists yet, please create your own.
49
- * Make sure that all applicable issues are mentioned somewhere in the PR description. This can be done by typing # to bring up a list of issues.
50
-
51
- ### Updating Your Pull Request (PR)
52
-
53
- A lot of times, making a PR adhere to the standards above can be difficult. If the maintainers notice anything that we'd like changed, we'll ask you to edit your PR before we merge it. This applies to both the content documented in the PR and the changed contained within the branch being merged. There's no need to open a new PR. Just edit the existing one.
54
-
55
- [email]: mailto:opensource@optum.com
@@ -1,30 +0,0 @@
1
- # Individual Contributor License Agreement ("Agreement") V2.0
2
-
3
- Thank you for your interest in this Optum project (the "PROJECT"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the PROJECT must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the PROJECT and its users; it does not change your rights to use your own Contributions for any other purpose.
4
-
5
- You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the PROJECT. In return, the PROJECT shall not use Your Contributions in a way that is inconsistent with stated project goals in effect at the time of the Contribution. Except for the license granted herein to the PROJECT and recipients of software distributed by the PROJECT, You reserve all right, title, and interest in and to Your Contributions.
6
- 1. Definitions.
7
-
8
- "You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with the PROJECT. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
9
-
10
- "Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to the PROJECT for inclusion in, or documentation of, any of the products owned or managed by the PROJECT (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the PROJECT or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the PROJECT for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
11
-
12
- 2. Grant of Copyright License.
13
-
14
- Subject to the terms and conditions of this Agreement, You hereby grant to the PROJECT and to recipients of software distributed by the PROJECT a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
15
-
16
- 3. Grant of Patent License.
17
-
18
- Subject to the terms and conditions of this Agreement, You hereby grant to the PROJECT and to recipients of software distributed by the PROJECT a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
19
-
20
- 4. Representations.
21
-
22
- (a) You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to the PROJECT, or that your employer has executed a separate Corporate CLA with the PROJECT.
23
-
24
- (b) You represent that each of Your Contributions is Your original creation (see section 6 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
25
-
26
- 5. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
27
-
28
- 6. Should You wish to submit work that is not Your original creation, You may submit it to the PROJECT separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
29
-
30
- 7. You agree to notify the PROJECT of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.
data/NOTICE.txt DELETED
@@ -1,9 +0,0 @@
1
- Legion::Logging(legion-logging)
2
- Copyright 2021 Optum
3
-
4
- Project Description:
5
- ====================
6
- A logging class used by the LegionIO framework
7
-
8
- Author(s):
9
- Esity
data/SECURITY.md DELETED
@@ -1,9 +0,0 @@
1
- # Security Policy
2
-
3
- ## Supported Versions
4
- | Version | Supported |
5
- | ------- | ------------------ |
6
- | 1.x.x | :white_check_mark: |
7
-
8
- ## Reporting a Vulnerability
9
- To be added
data/attribution.txt DELETED
@@ -1 +0,0 @@
1
- Add attributions here.
data/sourcehawk.yml DELETED
@@ -1,4 +0,0 @@
1
-
2
- config-locations:
3
- - https://raw.githubusercontent.com/optum/.github/main/sourcehawk.yml
4
-