syslog-logger 1.6.6 → 1.6.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- metadata +3 -4
- data/lib/syslog_logger_env_formatting.rb +0 -33
data/README.rdoc
CHANGED
@@ -17,6 +17,8 @@ will be ignored.
|
|
17
17
|
This particular Logger::Syslog improves the original by correctly mapping Rails log severities to
|
18
18
|
the Syslog counterparts. It also adds the ability to select a syslog facility other than "user."
|
19
19
|
|
20
|
+
Version 1.6.7 takes a formatter as logger does and uses call to format the message.
|
21
|
+
|
20
22
|
== SYNOPSIS:
|
21
23
|
|
22
24
|
=== config/environment.rb
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 6
|
8
|
-
-
|
9
|
-
version: 1.6.
|
8
|
+
- 7
|
9
|
+
version: 1.6.7
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Eric Hodel; Chris Powell; Matthew Boeh; Ian Lesperance; Dana Danger; Brian Smith; Ashley Martens
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-02-
|
17
|
+
date: 2012-02-14 00:00:00 -08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -28,7 +28,6 @@ extra_rdoc_files:
|
|
28
28
|
- README.rdoc
|
29
29
|
files:
|
30
30
|
- README.rdoc
|
31
|
-
- lib/syslog_logger_env_formatting.rb
|
32
31
|
has_rdoc: true
|
33
32
|
homepage: http://github.com/ngmoco/syslog_logger
|
34
33
|
licenses: []
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# Adds some default information to syslog messages.
|
2
|
-
# If you pass a User or Device object as the first parameter, it will log that user/device's id
|
3
|
-
# If you pass a block from a controller, it will automatically log the current user id
|
4
|
-
# If you pass a block, the class name of the block's context will be added
|
5
|
-
#
|
6
|
-
# Examples
|
7
|
-
# logger.debug "O'Doyle Rules!"
|
8
|
-
# #=> [development] [DEBUG: 2008-01-25 14:16:12.12345] O'Doyle Rules!
|
9
|
-
#
|
10
|
-
# #from within a controller...
|
11
|
-
# logger.error {"Something is messed up!"}
|
12
|
-
# #=> [development] [ERROR: 2008-01-25 14:16:12.12345] [123] [ClassName] Something is messed up!
|
13
|
-
|
14
|
-
class Logger::Syslog
|
15
|
-
|
16
|
-
# short names for "DEBUG", "INFO", ...
|
17
|
-
# must be ordered to correspond to severity constants defined in
|
18
|
-
# ActiveSupport::BufferedLogger::Severity
|
19
|
-
#@@log_level_names = %w( D I W E F U )
|
20
|
-
#LOG_NAME_FIELD_WIDTH = 1
|
21
|
-
|
22
|
-
@@log_level_names = %w( DEBUG INFO WARN ERROR FATAL UNKNOWN )
|
23
|
-
LOG_NAME_FIELD_WIDTH = 7
|
24
|
-
|
25
|
-
def add_with_formatting(severity, message = nil, progname = nil, &block)
|
26
|
-
severity ||= Logger::UNKNOWN
|
27
|
-
message = "[#{RAILS_ENV}] [#{@@log_level_names[severity].ljust(LOG_NAME_FIELD_WIDTH)}: #{time.strftime("%Y-%m-%d %H:%M:%S")}.#{time.usec.to_s.rjust(6, '0')}] #{message || block.call}"
|
28
|
-
|
29
|
-
add_without_formatting(severity, message, progname)
|
30
|
-
end
|
31
|
-
alias_method_chain :add, :formatting
|
32
|
-
|
33
|
-
end
|