franz 1.5.5 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/franz +3 -0
- data/lib/franz/logger.rb +10 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55da641aa1d850bea403f1fa8d16284d4c9e0744
|
4
|
+
data.tar.gz: de8c946eb160ef42df9db22a446757cc7932d011
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ed1d31db5af9431789c77ec990d3d12513906124879375645a146c73be7dce6f79c49390d805901bd341bfdef7a7951fa2b03a8de2e704f49822aa653cf2c13
|
7
|
+
data.tar.gz: 7651fc05d96b7a831b9c526895ec7692bf48f52f4eb09e5d00f5672fec252f1a00cc33054341ce5d52372c6d9c9ee7dc735a384dcca58e711a6b1083df18560f
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.5.
|
1
|
+
1.5.6
|
data/bin/franz
CHANGED
@@ -48,6 +48,9 @@ io_bound = config[:output][:bound] || 10_000
|
|
48
48
|
io = Queue.new
|
49
49
|
io = SizedQueue.new io_bound if io_bound > 0
|
50
50
|
|
51
|
+
logger.info \
|
52
|
+
event: 'boot',
|
53
|
+
version: Franz::VERSION
|
51
54
|
|
52
55
|
# Now we'll connect to our output, RabbitMQ. This creates a new thread in the
|
53
56
|
# background, which will consume the events generated by our input on io
|
data/lib/franz/logger.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
+
require 'socket'
|
1
2
|
require 'logger'
|
2
3
|
require 'time'
|
3
4
|
|
4
5
|
require 'colorize'
|
5
6
|
|
7
|
+
|
6
8
|
module Franz
|
9
|
+
HOSTNAME = Socket.gethostname
|
7
10
|
|
8
11
|
# Extending the Logger with TRACE capabilities
|
9
12
|
class ::Logger
|
@@ -45,14 +48,17 @@ module Franz
|
|
45
48
|
private
|
46
49
|
def format colorize
|
47
50
|
self.formatter = proc do |severity, datetime, _, message|
|
51
|
+
severity.downcase!
|
48
52
|
|
49
53
|
message = { message: message } unless message.is_a? Hash
|
50
54
|
|
51
55
|
event = {
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
type: :franz,
|
57
|
+
level: severity,
|
58
|
+
'@timestamp' => datetime.iso8601(3),
|
59
|
+
marker: File::basename(caller[4]),
|
60
|
+
host: HOSTNAME
|
61
|
+
}.merge message
|
56
62
|
|
57
63
|
if colorize # console output
|
58
64
|
event = JSON::pretty_generate(event) + "\n"
|