rails_semantic_logger 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -3
- data/Rakefile +1 -18
- data/lib/rails_semantic_logger/railtie.rb +6 -3
- data/lib/rails_semantic_logger/version.rb +1 -1
- metadata +9 -11
- data/Gemfile +0 -8
- data/Gemfile.lock +0 -107
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36528e325626ddbbc7964869d59283f14bf66aac
|
4
|
+
data.tar.gz: a8b4bcfbd7f2e57a103e71c4eedd29993c14400c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 321ec7c1747a125cfd2bc562917b4a4dcb1742fc4d23a81f842b6f1bf560cae35ca16ef620727f984c1d3853e00a1b19607470dba673538e5b9bf3253ccf277c
|
7
|
+
data.tar.gz: 374200a12bd398aa13dd9c0c3d1c4bc1a81b11b5fef236eb7ba5e670d0e7946016cd45d52fca43aed46ecbf128f7d83a023d9e2754f5de5259e7fd2ec771335b
|
data/README.md
CHANGED
@@ -58,12 +58,13 @@ Drop-in Replacement
|
|
58
58
|
* Supports current common logging interface
|
59
59
|
* No changes to existing to code to use new logger ( other than replacing the logger )
|
60
60
|
|
61
|
-
Rails 2 &
|
61
|
+
Rails 2, 3 & 4 Support
|
62
62
|
|
63
63
|
* Just include the semantic_logger gem into Rails and it will immediately
|
64
64
|
replace the existing loggers to improve performance and information
|
65
65
|
in the log files
|
66
66
|
* The Rails 3 Tagged logging feature is already available for Rails 2 by using Semantic Logger
|
67
|
+
* Rails 4 push_tags and pop_tags methods are supported
|
67
68
|
|
68
69
|
Thread Aware
|
69
70
|
|
@@ -423,12 +424,21 @@ config.after_initialize do
|
|
423
424
|
db = Mongo::Connection.new['production_logging']
|
424
425
|
|
425
426
|
# Besides logging to the standard Rails logger, also log to MongoDB
|
426
|
-
config.semantic_logger.
|
427
|
+
config.semantic_logger.add_appender SemanticLogger::Appender::MongoDB.new(
|
427
428
|
:db => db,
|
429
|
+
:collection_name => 'semantic_logger',
|
428
430
|
:collection_size => 25.gigabytes
|
429
431
|
)
|
430
432
|
end
|
431
433
|
```
|
434
|
+
|
435
|
+
If the Rails colorized logging is enabled, then the colorized formatter will be used
|
436
|
+
by default. To disable colorized logging in both Rails and SemanticLogger:
|
437
|
+
|
438
|
+
```ruby
|
439
|
+
config.colorize_logging = false
|
440
|
+
```
|
441
|
+
|
432
442
|
### Custom Appenders and Formatters
|
433
443
|
|
434
444
|
To write your own appenders or formatting, see [SemanticLogger](http://github.com/ClarityServices/semantic_logger)
|
@@ -441,7 +451,7 @@ to be rotated, use a copy-truncate operation rather than deleting the file.
|
|
441
451
|
### Dependencies
|
442
452
|
|
443
453
|
- Ruby MRI 1.8.7, 1.9.3 (or above) Or, JRuby 1.6.3 (or above)
|
444
|
-
- Rails 2 or above
|
454
|
+
- Rails 2, 3, 4 or above
|
445
455
|
|
446
456
|
Meta
|
447
457
|
----
|
data/Rakefile
CHANGED
@@ -5,27 +5,10 @@ require 'rubygems'
|
|
5
5
|
require 'rubygems/package'
|
6
6
|
require 'rake/clean'
|
7
7
|
require 'rake/testtask'
|
8
|
-
require 'date'
|
9
8
|
require 'rails_semantic_logger/version'
|
10
9
|
|
11
10
|
desc "Build gem"
|
12
11
|
task :gem do |t|
|
13
|
-
|
14
|
-
spec.name = 'rails_semantic_logger'
|
15
|
-
spec.version = RailsSemanticLogger::VERSION
|
16
|
-
spec.platform = Gem::Platform::RUBY
|
17
|
-
spec.authors = ['Reid Morrison']
|
18
|
-
spec.email = ['reidmo@gmail.com']
|
19
|
-
spec.homepage = 'https://github.com/ClarityServices/rails_semantic_logger'
|
20
|
-
spec.date = Date.today.to_s
|
21
|
-
spec.summary = "Improved logging for Ruby on Rails"
|
22
|
-
spec.description = "Replaces the default Rails logger with SemanticLogger"
|
23
|
-
spec.files = FileList["./**/*"].exclude(/\.gem$/, /\.log$/,/nbproject/).map{|f| f.sub(/^\.\//, '')}
|
24
|
-
spec.license = "Apache License V2.0"
|
25
|
-
spec.has_rdoc = true
|
26
|
-
spec.add_dependency 'semantic_logger', '>= 2.1'
|
27
|
-
#spec.add_dependency 'rails', '>= 2'
|
28
|
-
end
|
29
|
-
Gem::Package.build gemspec
|
12
|
+
Gem::Package.build(Gem::Specification.load('rails_semantic_logger.gemspec'))
|
30
13
|
end
|
31
14
|
|
@@ -44,9 +44,11 @@ module RailsSemanticLogger #:nodoc:
|
|
44
44
|
SemanticLogger::Logger.logger = appender
|
45
45
|
|
46
46
|
# Add the log file to the list of appenders
|
47
|
-
|
47
|
+
# Use the colorized formatter if Rails colorized logs are enabled
|
48
|
+
formatter = SemanticLogger::Appender::Base.colorized_formatter if config.colorize_logging
|
49
|
+
SemanticLogger.add_appender(path, nil, &formatter)
|
48
50
|
SemanticLogger[Rails]
|
49
|
-
rescue StandardError
|
51
|
+
rescue StandardError => exc
|
50
52
|
# If not able to log to file, log to standard error with warning level only
|
51
53
|
SemanticLogger.default_level = :warn
|
52
54
|
|
@@ -56,7 +58,8 @@ module RailsSemanticLogger #:nodoc:
|
|
56
58
|
logger = SemanticLogger[Rails]
|
57
59
|
logger.warn(
|
58
60
|
"Rails Error: Unable to access log file. Please ensure that #{path} exists and is chmod 0666. " +
|
59
|
-
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
|
61
|
+
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.",
|
62
|
+
exc
|
60
63
|
)
|
61
64
|
logger
|
62
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_semantic_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.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: 2013-
|
11
|
+
date: 2013-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic_logger
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.3'
|
27
27
|
description: Replaces the default Rails logger with SemanticLogger
|
28
28
|
email:
|
29
29
|
- reidmo@gmail.com
|
@@ -31,14 +31,12 @@ executables: []
|
|
31
31
|
extensions: []
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
|
-
- Gemfile
|
35
|
-
- Gemfile.lock
|
36
|
-
- LICENSE.txt
|
37
|
-
- README.md
|
38
|
-
- Rakefile
|
39
|
-
- lib/rails_semantic_logger.rb
|
40
34
|
- lib/rails_semantic_logger/railtie.rb
|
41
35
|
- lib/rails_semantic_logger/version.rb
|
36
|
+
- lib/rails_semantic_logger.rb
|
37
|
+
- LICENSE.txt
|
38
|
+
- Rakefile
|
39
|
+
- README.md
|
42
40
|
homepage: https://github.com/ClarityServices/rails_semantic_logger
|
43
41
|
licenses:
|
44
42
|
- Apache License V2.0
|
@@ -59,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
57
|
version: '0'
|
60
58
|
requirements: []
|
61
59
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.0.
|
60
|
+
rubygems_version: 2.0.3
|
63
61
|
signing_key:
|
64
62
|
specification_version: 4
|
65
63
|
summary: Improved logging for Ruby on Rails
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,107 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
actionmailer (3.2.12)
|
5
|
-
actionpack (= 3.2.12)
|
6
|
-
mail (~> 2.4.4)
|
7
|
-
actionpack (3.2.12)
|
8
|
-
activemodel (= 3.2.12)
|
9
|
-
activesupport (= 3.2.12)
|
10
|
-
builder (~> 3.0.0)
|
11
|
-
erubis (~> 2.7.0)
|
12
|
-
journey (~> 1.0.4)
|
13
|
-
rack (~> 1.4.5)
|
14
|
-
rack-cache (~> 1.2)
|
15
|
-
rack-test (~> 0.6.1)
|
16
|
-
sprockets (~> 2.2.1)
|
17
|
-
activemodel (3.2.12)
|
18
|
-
activesupport (= 3.2.12)
|
19
|
-
builder (~> 3.0.0)
|
20
|
-
activerecord (3.2.12)
|
21
|
-
activemodel (= 3.2.12)
|
22
|
-
activesupport (= 3.2.12)
|
23
|
-
arel (~> 3.0.2)
|
24
|
-
tzinfo (~> 0.3.29)
|
25
|
-
activeresource (3.2.12)
|
26
|
-
activemodel (= 3.2.12)
|
27
|
-
activesupport (= 3.2.12)
|
28
|
-
activesupport (3.2.12)
|
29
|
-
i18n (~> 0.6)
|
30
|
-
multi_json (~> 1.0)
|
31
|
-
arel (3.0.2)
|
32
|
-
atomic (1.0.1)
|
33
|
-
bourne (1.1.2)
|
34
|
-
mocha (= 0.10.5)
|
35
|
-
builder (3.0.4)
|
36
|
-
erubis (2.7.0)
|
37
|
-
hike (1.2.1)
|
38
|
-
i18n (0.6.4)
|
39
|
-
journey (1.0.4)
|
40
|
-
json (1.7.7)
|
41
|
-
mail (2.4.4)
|
42
|
-
i18n (>= 0.4.0)
|
43
|
-
mime-types (~> 1.16)
|
44
|
-
treetop (~> 1.4.8)
|
45
|
-
metaclass (0.0.1)
|
46
|
-
mime-types (1.21)
|
47
|
-
mocha (0.10.5)
|
48
|
-
metaclass (~> 0.0.1)
|
49
|
-
multi_json (1.6.1)
|
50
|
-
polyglot (0.3.3)
|
51
|
-
rack (1.4.5)
|
52
|
-
rack-cache (1.2)
|
53
|
-
rack (>= 0.4)
|
54
|
-
rack-ssl (1.3.3)
|
55
|
-
rack
|
56
|
-
rack-test (0.6.2)
|
57
|
-
rack (>= 1.0)
|
58
|
-
rails (3.2.12)
|
59
|
-
actionmailer (= 3.2.12)
|
60
|
-
actionpack (= 3.2.12)
|
61
|
-
activerecord (= 3.2.12)
|
62
|
-
activeresource (= 3.2.12)
|
63
|
-
activesupport (= 3.2.12)
|
64
|
-
bundler (~> 1.0)
|
65
|
-
railties (= 3.2.12)
|
66
|
-
railties (3.2.12)
|
67
|
-
actionpack (= 3.2.12)
|
68
|
-
activesupport (= 3.2.12)
|
69
|
-
rack-ssl (~> 1.3.2)
|
70
|
-
rake (>= 0.8.7)
|
71
|
-
rdoc (~> 3.4)
|
72
|
-
thor (>= 0.14.6, < 2.0)
|
73
|
-
rake (10.0.3)
|
74
|
-
rdoc (3.12.2)
|
75
|
-
json (~> 1.4)
|
76
|
-
semantic_logger (2.0.0)
|
77
|
-
sync_attr
|
78
|
-
thread_safe
|
79
|
-
shoulda (3.3.2)
|
80
|
-
shoulda-context (~> 1.0.1)
|
81
|
-
shoulda-matchers (~> 1.4.1)
|
82
|
-
shoulda-context (1.0.2)
|
83
|
-
shoulda-matchers (1.4.2)
|
84
|
-
activesupport (>= 3.0.0)
|
85
|
-
bourne (~> 1.1.2)
|
86
|
-
sprockets (2.2.2)
|
87
|
-
hike (~> 1.2)
|
88
|
-
multi_json (~> 1.0)
|
89
|
-
rack (~> 1.0)
|
90
|
-
tilt (~> 1.1, != 1.3.0)
|
91
|
-
sync_attr (0.1.1)
|
92
|
-
thor (0.17.0)
|
93
|
-
thread_safe (0.1.0)
|
94
|
-
atomic
|
95
|
-
tilt (1.3.4)
|
96
|
-
treetop (1.4.12)
|
97
|
-
polyglot
|
98
|
-
polyglot (>= 0.3.1)
|
99
|
-
tzinfo (0.3.36)
|
100
|
-
|
101
|
-
PLATFORMS
|
102
|
-
ruby
|
103
|
-
|
104
|
-
DEPENDENCIES
|
105
|
-
rails (>= 3.0.10)
|
106
|
-
semantic_logger (>= 2.0.0)
|
107
|
-
shoulda
|