lumberjack_syslog_device 1.1.0 → 2.0.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/.github/dependabot.yml +12 -0
- data/.github/workflows/continuous_integration.yml +47 -0
- data/.standard.yml +10 -0
- data/CHANGE_LOG.md +37 -2
- data/README.md +33 -4
- data/VERSION +1 -1
- data/lib/lumberjack/syslog_device.rb +136 -0
- data/lib/lumberjack_syslog_device.rb +1 -126
- data/lumberjack_syslog_device.gemspec +19 -11
- metadata +22 -19
- /data/{MIT_LICENSE → MIT_LICENSE.txt} +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 54c251e482e25bc736ad9947d10faee5afe7ea0df526df3ba7aaf80cb2487258
|
|
4
|
+
data.tar.gz: 1a190f22ebeb58d6b93388184b01270c8348f00444e3d94b122239c89791c9da
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0d0091c9a2887b37f471fe65ce665fca5047d399c116ccf29305d401b1888c9094cd0c09bc98f4682043241aed7df2da0b1434b3d8e7959453bcb503b4a23ef0
|
|
7
|
+
data.tar.gz: 8dcb7a000c0c391fe1d92a07e7e0bf021fdd3120ddccdde277f5a33ff902bdb86f38a895b6437001ce61d039a9a42a8a7cbc772a86c53e58d7a7600a9b400a6f
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Dependabot update strategy
|
|
2
|
+
version: 2
|
|
3
|
+
updates:
|
|
4
|
+
- package-ecosystem: bundler
|
|
5
|
+
directory: "/"
|
|
6
|
+
schedule:
|
|
7
|
+
interval: weekly
|
|
8
|
+
allow:
|
|
9
|
+
# Automatically keep all runtime dependencies updated
|
|
10
|
+
- dependency-name: "*"
|
|
11
|
+
dependency-type: "production"
|
|
12
|
+
versioning-strategy: lockfile-only
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Continuous Integration
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- actions-*
|
|
8
|
+
pull_request:
|
|
9
|
+
branches-ignore:
|
|
10
|
+
- actions-*
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
env:
|
|
14
|
+
BUNDLE_CLEAN: "true"
|
|
15
|
+
BUNDLE_PATH: vendor/bundle
|
|
16
|
+
BUNDLE_JOBS: 3
|
|
17
|
+
BUNDLE_RETRY: 3
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
name: ${{ matrix.ruby }} build
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
strategy:
|
|
24
|
+
matrix:
|
|
25
|
+
include:
|
|
26
|
+
- ruby: "ruby"
|
|
27
|
+
standardrb: true
|
|
28
|
+
yard: true
|
|
29
|
+
- ruby: "3.0"
|
|
30
|
+
- ruby: "2.7"
|
|
31
|
+
steps:
|
|
32
|
+
- uses: actions/checkout@v4
|
|
33
|
+
- name: Set up Ruby
|
|
34
|
+
uses: ruby/setup-ruby@v1
|
|
35
|
+
with:
|
|
36
|
+
ruby-version: ${{ matrix.ruby}}
|
|
37
|
+
- name: Install gems
|
|
38
|
+
run: |
|
|
39
|
+
bundle install
|
|
40
|
+
- name: Run Tests
|
|
41
|
+
run: bundle exec rake
|
|
42
|
+
- name: standardrb
|
|
43
|
+
if: matrix.standardrb
|
|
44
|
+
run: bundle exec standardrb
|
|
45
|
+
- name: yard
|
|
46
|
+
if: matrix.yard == true
|
|
47
|
+
run: bundle exec yard --fail-on-warning
|
data/.standard.yml
ADDED
data/CHANGE_LOG.md
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
|
+
All notable changes to this project will be documented in this file.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## 2.0.0
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Lumberjack 2 support.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Updated default template to `{{message}} {{attributes}}`. Unit of work is no longer supported in Lumberjack 2.
|
|
16
|
+
- Updated attribute formatting to use tag formatting specified in the `:tag_format` option rather than hardcoding the format.
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- Support for Ruby < 2.7.
|
|
21
|
+
|
|
22
|
+
## 1.1.1
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Always cast values to strings before logging to syslog (thanks @eremeyev).
|
|
27
|
+
|
|
28
|
+
## 1.1.0
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Add support for lumberjack 1.1 tags.
|
|
33
|
+
|
|
34
|
+
## 1.0.0
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- Initial release.
|
data/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# Lumberjack Syslog Device
|
|
2
2
|
|
|
3
|
-
[](https://github.com/bdurand/lumberjack_syslog_device/actions/workflows/continuous_integration.yml)
|
|
4
|
+
[](https://github.com/testdouble/standard)
|
|
5
|
+
[](https://badge.fury.io/rb/lumberjack_syslog_device)
|
|
5
6
|
|
|
6
7
|
This gem provides a logging device for the [lumberjack](https://github.com/bdurand/lumberjack) gem that will log to syslog, the centralized system logging facility. See http://en.wikipedia.org/wiki/Syslog for more information on syslog.
|
|
7
8
|
|
|
8
|
-
##
|
|
9
|
+
## Usage
|
|
9
10
|
|
|
10
11
|
```ruby
|
|
11
12
|
require 'lumberjack_syslog_device'
|
|
@@ -15,4 +16,32 @@ logger = Lumberjack::Logger.new(device)
|
|
|
15
16
|
logger.info("Write me to syslog!")
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
See SyslogDevice for more details.
|
|
19
|
+
See the docs in the Lumberjack::SyslogDevice file for more details.
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
Add this line to your application's Gemfile:
|
|
24
|
+
|
|
25
|
+
```ruby
|
|
26
|
+
gem 'lumberjack_syslog_device'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
And then execute:
|
|
30
|
+
```bash
|
|
31
|
+
$ bundle
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or install it yourself as:
|
|
35
|
+
```bash
|
|
36
|
+
$ gem install lumberjack_syslog_device
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Contributing
|
|
40
|
+
|
|
41
|
+
Open a pull request on GitHub.
|
|
42
|
+
|
|
43
|
+
Please use the [standardrb](https://github.com/testdouble/standard) syntax and lint your code with `standardrb --fix` before submitting.
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.0.0
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "syslog"
|
|
4
|
+
require "lumberjack"
|
|
5
|
+
|
|
6
|
+
# Lumberjack is a simple, powerful, and very fast logging utility that can be a drop
|
|
7
|
+
# in replacement for Logger or ActiveSupport::BufferedLogger.
|
|
8
|
+
module Lumberjack
|
|
9
|
+
# This Lumberjack device logs output to syslog. There can only be one connection to syslog
|
|
10
|
+
# open at a time. If you use syslog elsewhere in your application, you'll need to pass
|
|
11
|
+
# :close_connection => true to the constructor. Otherwise, the connection will be kept
|
|
12
|
+
# open between +write+ calls.
|
|
13
|
+
class SyslogDevice < Device
|
|
14
|
+
VERSION = ::File.read(::File.join(__dir__, "..", "..", "VERSION")).strip.freeze
|
|
15
|
+
|
|
16
|
+
# Mapping of Lumberjack severity levels to syslog priority levels
|
|
17
|
+
SEVERITY_MAP = {
|
|
18
|
+
Severity::TRACE => Syslog::LOG_DEBUG,
|
|
19
|
+
Severity::DEBUG => Syslog::LOG_DEBUG,
|
|
20
|
+
Severity::INFO => Syslog::LOG_INFO,
|
|
21
|
+
Severity::WARN => Syslog::LOG_WARNING,
|
|
22
|
+
Severity::ERROR => Syslog::LOG_ERR,
|
|
23
|
+
Severity::FATAL => Syslog::LOG_CRIT,
|
|
24
|
+
Severity::UNKNOWN => Syslog::LOG_ALERT
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
# Literal percent character
|
|
28
|
+
PERCENT = "%"
|
|
29
|
+
# Escaped percent character for syslog format strings
|
|
30
|
+
ESCAPED_PERCENT = "%%"
|
|
31
|
+
|
|
32
|
+
# Default template for formatting log messages
|
|
33
|
+
DEFAULT_TEMPLATE = "{{message}} {{attributes}}"
|
|
34
|
+
# Default format for rendering log entry attributes
|
|
35
|
+
DEFAULT_ATTRIBUTE_FORMAT = "[%s:%s]"
|
|
36
|
+
|
|
37
|
+
DeviceRegistry.add(:syslog, self)
|
|
38
|
+
|
|
39
|
+
@@lock = Mutex.new
|
|
40
|
+
|
|
41
|
+
# Create a new SyslogDevice. The options control how messages are written to syslog.
|
|
42
|
+
#
|
|
43
|
+
# The template can be specified using the :template option. This can
|
|
44
|
+
# either be a Proc or a string that will compile into a Template object.
|
|
45
|
+
# If the template is a Proc, it should accept an LogEntry as its only argument and output a string.
|
|
46
|
+
# If the template is a template string, it will be used to create a Template.
|
|
47
|
+
# The default template is +{{message}} {{attributes}}+.
|
|
48
|
+
#
|
|
49
|
+
# The :close_connection option can be used to specify that the connection to syslog should be
|
|
50
|
+
# closed after every +write+ call. This will slow down performance, but will allow you to use syslog
|
|
51
|
+
# elsewhere in your application.
|
|
52
|
+
#
|
|
53
|
+
# The :options option will pass through options to syslog. The default is
|
|
54
|
+
# Syslog::LOG_PID | Syslog::LOG_CONS. Available values for the bit map are:
|
|
55
|
+
# * Syslog::LOG_CONS - Write directly to system console if there is an error while sending to system logger.
|
|
56
|
+
# * Syslog::LOG_NDELAY - Open the connection immediately (normally, the connection is opened when the first message is logged).
|
|
57
|
+
# * Syslog::LOG_NOWAIT - Don't wait for child processes that may have been created while logging the message.
|
|
58
|
+
# * Syslog::LOG_ODELAY - The converse of LOG_NDELAY; opening of the connection is delayed.
|
|
59
|
+
# * Syslog::LOG_PERROR - Print to stderr as well.
|
|
60
|
+
# * Syslog::LOG_PID - Include PID with each message.
|
|
61
|
+
#
|
|
62
|
+
# The :facility option will pass through a facility to syslog. Available values are
|
|
63
|
+
# * Syslog::LOG_AUTH
|
|
64
|
+
# * Syslog::LOG_AUTHPRIV
|
|
65
|
+
# * Syslog::LOG_CRON
|
|
66
|
+
# * Syslog::LOG_DAEMON
|
|
67
|
+
# * Syslog::LOG_FTP
|
|
68
|
+
# * Syslog::LOG_KERN
|
|
69
|
+
# * Syslog::LOG_LOCAL0 through Syslog::LOG_LOCAL7
|
|
70
|
+
# * Syslog::LOG_LPR
|
|
71
|
+
# * Syslog::LOG_MAIL
|
|
72
|
+
# * Syslog::LOG_NEWS
|
|
73
|
+
# * Syslog::LOG_SYSLOG
|
|
74
|
+
# * Syslog::LOG_USER (default)
|
|
75
|
+
# * Syslog::LOG_UUCP
|
|
76
|
+
def initialize(options = {})
|
|
77
|
+
@template = options[:template] || DEFAULT_TEMPLATE
|
|
78
|
+
attribute_format = options[:attribute_format] || DEFAULT_ATTRIBUTE_FORMAT
|
|
79
|
+
@template = Template.new(@template, attribute_format: attribute_format) if @template.is_a?(String)
|
|
80
|
+
|
|
81
|
+
@syslog_options = options[:options] || (Syslog::LOG_PID | Syslog::LOG_CONS)
|
|
82
|
+
@syslog_facility = options[:facility]
|
|
83
|
+
@close_connection = options[:close_connection]
|
|
84
|
+
@syslog_identity = nil
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Write a log entry to syslog.
|
|
88
|
+
#
|
|
89
|
+
# @param entry [Lumberjack::LogEntry] the log entry to write
|
|
90
|
+
# @return [void]
|
|
91
|
+
def write(entry)
|
|
92
|
+
message = @template.call(entry).to_s.chomp.gsub(PERCENT, ESCAPED_PERCENT)
|
|
93
|
+
@@lock.synchronize do
|
|
94
|
+
syslog = open_syslog(entry.progname)
|
|
95
|
+
begin
|
|
96
|
+
syslog.log(SEVERITY_MAP[entry.severity], message)
|
|
97
|
+
ensure
|
|
98
|
+
syslog.close if @close_connection
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Close the syslog connection.
|
|
104
|
+
#
|
|
105
|
+
# @return [void]
|
|
106
|
+
def close
|
|
107
|
+
flush
|
|
108
|
+
@lock.synchronize do
|
|
109
|
+
@syslog.close if @syslog&.opened?
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
private
|
|
114
|
+
|
|
115
|
+
# Open syslog with ident set to progname. If it is already open with a different
|
|
116
|
+
# ident, close it and reopen it.
|
|
117
|
+
def open_syslog(progname) # :nodoc:
|
|
118
|
+
syslog_impl = syslog_implementation
|
|
119
|
+
if syslog_impl.opened?
|
|
120
|
+
if (progname.nil? || syslog_impl.ident == progname.to_s) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
|
|
121
|
+
return syslog_impl
|
|
122
|
+
else
|
|
123
|
+
syslog_impl.close
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
syslog = syslog_impl.open(progname.to_s, @syslog_options, @syslog_facility)
|
|
127
|
+
syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_DEBUG)
|
|
128
|
+
syslog
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Provided for testing purposes
|
|
132
|
+
def syslog_implementation # :nodoc:
|
|
133
|
+
Syslog
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
@@ -1,128 +1,3 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
require 'lumberjack'
|
|
5
|
-
|
|
6
|
-
module Lumberjack
|
|
7
|
-
# This Lumberjack device logs output to syslog. There can only be one connection to syslog
|
|
8
|
-
# open at a time. If you use syslog elsewhere in your application, you'll need to pass
|
|
9
|
-
# :close_connection => true to the constructor. Otherwise, the connection will be kept
|
|
10
|
-
# open between +write+ calls.
|
|
11
|
-
class SyslogDevice < Device
|
|
12
|
-
SEVERITY_MAP = {
|
|
13
|
-
Severity::DEBUG => Syslog::LOG_DEBUG,
|
|
14
|
-
Severity::INFO => Syslog::LOG_INFO,
|
|
15
|
-
Severity::WARN => Syslog::LOG_WARNING,
|
|
16
|
-
Severity::ERROR => Syslog::LOG_ERR,
|
|
17
|
-
Severity::FATAL => Syslog::LOG_CRIT,
|
|
18
|
-
Severity::UNKNOWN => Syslog::LOG_ALERT
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
PERCENT = '%'
|
|
22
|
-
ESCAPED_PERCENT = '%%'
|
|
23
|
-
|
|
24
|
-
@@lock = Mutex.new
|
|
25
|
-
|
|
26
|
-
# Create a new SyslogDevice. The options control how messages are written to syslog.
|
|
27
|
-
#
|
|
28
|
-
# The template can be specified using the :template option. This can
|
|
29
|
-
# either be a Proc or a string that will compile into a Template object.
|
|
30
|
-
# If the template is a Proc, it should accept an LogEntry as its only argument and output a string.
|
|
31
|
-
# If the template is a template string, it will be used to create a Template.
|
|
32
|
-
# The default template is `:message (#:unit_of_work_id) :tags`.
|
|
33
|
-
#
|
|
34
|
-
# The :close_connection option can be used to specify that the connection to syslog should be
|
|
35
|
-
# closed after every +write+ call. This will slow down performance, but will allow you to use syslog
|
|
36
|
-
# elsewhere in your application.
|
|
37
|
-
#
|
|
38
|
-
# The :options option will pass through options to syslog. The default is
|
|
39
|
-
# Syslog::LOG_PID | Syslog::LOG_CONS. Available values for the bit map are:
|
|
40
|
-
# * Syslog::LOG_CONS - Write directly to system console if there is an error while sending to system logger.
|
|
41
|
-
# * Syslog::LOG_NDELAY - Open the connection immediately (normally, the connection is opened when the first message is logged).
|
|
42
|
-
# * Syslog::LOG_NOWAIT - Don't wait for child processes that may have been created while logging the message.
|
|
43
|
-
# * Syslog::LOG_ODELAY - The converse of LOG_NDELAY; opening of the connection is delayed.
|
|
44
|
-
# * Syslog::LOG_PERROR - Print to stderr as well.
|
|
45
|
-
# * Syslog::LOG_PID - Include PID with each message.
|
|
46
|
-
#
|
|
47
|
-
# The :facility option will pass through a facility to syslog. Available values are
|
|
48
|
-
# * Syslog::LOG_AUTH
|
|
49
|
-
# * Syslog::LOG_AUTHPRIV
|
|
50
|
-
# * Syslog::LOG_CRON
|
|
51
|
-
# * Syslog::LOG_DAEMON
|
|
52
|
-
# * Syslog::LOG_FTP
|
|
53
|
-
# * Syslog::LOG_KERN
|
|
54
|
-
# * Syslog::LOG_LOCAL0 through Syslog::LOG_LOCAL7
|
|
55
|
-
# * Syslog::LOG_LPR
|
|
56
|
-
# * Syslog::LOG_MAIL
|
|
57
|
-
# * Syslog::LOG_NEWS
|
|
58
|
-
# * Syslog::LOG_SYSLOG
|
|
59
|
-
# * Syslog::LOG_USER (default)
|
|
60
|
-
# * Syslog::LOG_UUCP
|
|
61
|
-
def initialize(options = {})
|
|
62
|
-
@template = options[:template] || default_template
|
|
63
|
-
@template = Template.new(@template) if @template.is_a?(String)
|
|
64
|
-
@syslog_options = options[:options] || (Syslog::LOG_PID | Syslog::LOG_CONS)
|
|
65
|
-
@syslog_facility = options[:facility]
|
|
66
|
-
@close_connection = options[:close_connection]
|
|
67
|
-
@syslog_identity = nil
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def write(entry)
|
|
71
|
-
message = @template.call(entry).gsub(PERCENT, ESCAPED_PERCENT)
|
|
72
|
-
@@lock.synchronize do
|
|
73
|
-
syslog = open_syslog(entry.progname)
|
|
74
|
-
begin
|
|
75
|
-
syslog.log(SEVERITY_MAP[entry.severity], message)
|
|
76
|
-
ensure
|
|
77
|
-
syslog.close if @close_connection
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def close
|
|
83
|
-
flush
|
|
84
|
-
@lock.synchronize do
|
|
85
|
-
@syslog.close if @syslog && @syslog.opened?
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
private
|
|
90
|
-
|
|
91
|
-
# Open syslog with ident set to progname. If it is already open with a different
|
|
92
|
-
# ident, close it and reopen it.
|
|
93
|
-
def open_syslog(progname) #:nodoc:
|
|
94
|
-
syslog_impl = syslog_implementation
|
|
95
|
-
if syslog_impl.opened?
|
|
96
|
-
if (progname.nil? || syslog_impl.ident == progname) && @syslog_facility == syslog_impl.facility && @syslog_options == syslog_impl.options
|
|
97
|
-
return syslog_impl
|
|
98
|
-
else
|
|
99
|
-
syslog_impl.close
|
|
100
|
-
end
|
|
101
|
-
end
|
|
102
|
-
syslog = syslog_impl.open(progname, @syslog_options, @syslog_facility)
|
|
103
|
-
syslog.mask = Syslog::LOG_UPTO(Syslog::LOG_DEBUG)
|
|
104
|
-
syslog
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
# Provided for testing purposes
|
|
108
|
-
def syslog_implementation #:nodoc:
|
|
109
|
-
Syslog
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
def default_template
|
|
113
|
-
lambda do |entry|
|
|
114
|
-
tags = entry.tags
|
|
115
|
-
if tags && !tags.empty?
|
|
116
|
-
message = String.new(entry.message)
|
|
117
|
-
message << " (#{entry.unit_of_work_id})" if entry.unit_of_work_id
|
|
118
|
-
tags.each do |name, value|
|
|
119
|
-
message << " [#{name}:#{value.inspect}]" unless name == Lumberjack::LogEntry::UNIT_OF_WORK_ID
|
|
120
|
-
end
|
|
121
|
-
message
|
|
122
|
-
else
|
|
123
|
-
entry.message
|
|
124
|
-
end
|
|
125
|
-
end
|
|
126
|
-
end
|
|
127
|
-
end
|
|
128
|
-
end
|
|
3
|
+
require_relative "lumberjack/syslog_device"
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
|
-
spec.name =
|
|
2
|
+
spec.name = "lumberjack_syslog_device"
|
|
3
3
|
spec.version = File.read(File.expand_path("../VERSION", __FILE__)).strip
|
|
4
|
-
spec.authors = [
|
|
5
|
-
spec.email = [
|
|
4
|
+
spec.authors = ["Brian Durand"]
|
|
5
|
+
spec.email = ["bbdurand@gmail.com"]
|
|
6
6
|
|
|
7
7
|
spec.summary = "A logging device for the lumberjack gem that writes log entries to syslog."
|
|
8
8
|
spec.homepage = "https://github.com/bdurand/lumberjack_syslog_device"
|
|
9
9
|
spec.license = "MIT"
|
|
10
10
|
|
|
11
|
+
spec.metadata = {
|
|
12
|
+
"homepage_uri" => spec.homepage,
|
|
13
|
+
"source_code_uri" => spec.homepage,
|
|
14
|
+
"changelog_uri" => "#{spec.homepage}/blob/main/CHANGE_LOG.md"
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
# Specify which files should be added to the gem when it is released.
|
|
12
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
13
|
-
ignore_files = %w
|
|
19
|
+
ignore_files = %w[
|
|
14
20
|
.gitignore
|
|
15
21
|
.travis.yml
|
|
16
22
|
Appraisals
|
|
@@ -19,15 +25,17 @@ Gem::Specification.new do |spec|
|
|
|
19
25
|
Rakefile
|
|
20
26
|
gemfiles/
|
|
21
27
|
spec/
|
|
22
|
-
|
|
23
|
-
spec.files = Dir.chdir(File.expand_path(
|
|
24
|
-
`git ls-files -z`.split("\x0").reject{ |f| ignore_files.any?{ |path| f.start_with?(path) } }
|
|
28
|
+
]
|
|
29
|
+
spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
|
|
30
|
+
`git ls-files -z`.split("\x0").reject { |f| ignore_files.any? { |path| f.start_with?(path) } }
|
|
25
31
|
end
|
|
26
32
|
|
|
27
|
-
spec.require_paths = [
|
|
33
|
+
spec.require_paths = ["lib"]
|
|
34
|
+
|
|
35
|
+
spec.required_ruby_version = ">=2.7"
|
|
28
36
|
|
|
29
|
-
spec.add_dependency "lumberjack", ">=
|
|
37
|
+
spec.add_dependency "lumberjack", ">=2.0"
|
|
38
|
+
spec.add_dependency "syslog"
|
|
30
39
|
|
|
31
|
-
spec.add_development_dependency
|
|
32
|
-
spec.add_development_dependency "rake"
|
|
40
|
+
spec.add_development_dependency "bundler"
|
|
33
41
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lumberjack_syslog_device
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brian Durand
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: lumberjack
|
|
@@ -16,30 +15,30 @@ dependencies:
|
|
|
16
15
|
requirements:
|
|
17
16
|
- - ">="
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '2.0'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
25
|
+
version: '2.0'
|
|
27
26
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
27
|
+
name: syslog
|
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
|
30
29
|
requirements:
|
|
31
|
-
- - "
|
|
30
|
+
- - ">="
|
|
32
31
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
34
|
-
type: :
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
35
34
|
prerelease: false
|
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
36
|
requirements:
|
|
38
|
-
- - "
|
|
37
|
+
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
39
|
+
version: '0'
|
|
41
40
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
41
|
+
name: bundler
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
44
|
- - ">="
|
|
@@ -52,24 +51,29 @@ dependencies:
|
|
|
52
51
|
- - ">="
|
|
53
52
|
- !ruby/object:Gem::Version
|
|
54
53
|
version: '0'
|
|
55
|
-
description:
|
|
56
54
|
email:
|
|
57
55
|
- bbdurand@gmail.com
|
|
58
56
|
executables: []
|
|
59
57
|
extensions: []
|
|
60
58
|
extra_rdoc_files: []
|
|
61
59
|
files:
|
|
60
|
+
- ".github/dependabot.yml"
|
|
61
|
+
- ".github/workflows/continuous_integration.yml"
|
|
62
|
+
- ".standard.yml"
|
|
62
63
|
- CHANGE_LOG.md
|
|
63
|
-
- MIT_LICENSE
|
|
64
|
+
- MIT_LICENSE.txt
|
|
64
65
|
- README.md
|
|
65
66
|
- VERSION
|
|
67
|
+
- lib/lumberjack/syslog_device.rb
|
|
66
68
|
- lib/lumberjack_syslog_device.rb
|
|
67
69
|
- lumberjack_syslog_device.gemspec
|
|
68
70
|
homepage: https://github.com/bdurand/lumberjack_syslog_device
|
|
69
71
|
licenses:
|
|
70
72
|
- MIT
|
|
71
|
-
metadata:
|
|
72
|
-
|
|
73
|
+
metadata:
|
|
74
|
+
homepage_uri: https://github.com/bdurand/lumberjack_syslog_device
|
|
75
|
+
source_code_uri: https://github.com/bdurand/lumberjack_syslog_device
|
|
76
|
+
changelog_uri: https://github.com/bdurand/lumberjack_syslog_device/blob/main/CHANGE_LOG.md
|
|
73
77
|
rdoc_options: []
|
|
74
78
|
require_paths:
|
|
75
79
|
- lib
|
|
@@ -77,15 +81,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
77
81
|
requirements:
|
|
78
82
|
- - ">="
|
|
79
83
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: '
|
|
84
|
+
version: '2.7'
|
|
81
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
86
|
requirements:
|
|
83
87
|
- - ">="
|
|
84
88
|
- !ruby/object:Gem::Version
|
|
85
89
|
version: '0'
|
|
86
90
|
requirements: []
|
|
87
|
-
rubygems_version: 3.
|
|
88
|
-
signing_key:
|
|
91
|
+
rubygems_version: 3.6.9
|
|
89
92
|
specification_version: 4
|
|
90
93
|
summary: A logging device for the lumberjack gem that writes log entries to syslog.
|
|
91
94
|
test_files: []
|
|
File without changes
|