rails_semantic_logger 1.0.0 → 1.1.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 +7 -0
- data/Gemfile.lock +107 -0
- data/Rakefile +6 -4
- data/lib/rails_semantic_logger/railtie.rb +11 -13
- data/lib/rails_semantic_logger/version.rb +1 -1
- metadata +40 -69
- data/nbproject/private/private.properties +0 -1
- data/nbproject/project.properties +0 -5
- data/nbproject/project.xml +0 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5441e9f7bfaf4e8afbf13c165f0e0bed2a9ba189
|
4
|
+
data.tar.gz: 95a734c35457252729140cb23d79203d6a93cfe4
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 168f1729904d8f38f591f67ccb0d06d0de49c5faccea46008398e6a13fb8dd70ebd0abf1acd0fc688e64954733a3204420a3dd1f8c4017b727e75477b07e2bd7
|
7
|
+
data.tar.gz: 55858036e0f7ffe5a4cac142222644a118f182cefb253d25744ae364bd3572c056ea43931ffb25c7c63a319a0bb3c87303b858bb9a633cf4e6054a1f54692093
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,107 @@
|
|
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
|
data/Rakefile
CHANGED
@@ -2,6 +2,7 @@ lib = File.expand_path('../lib/', __FILE__)
|
|
2
2
|
$:.unshift lib unless $:.include?(lib)
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
|
+
require 'rubygems/package'
|
5
6
|
require 'rake/clean'
|
6
7
|
require 'rake/testtask'
|
7
8
|
require 'date'
|
@@ -19,11 +20,12 @@ task :gem do |t|
|
|
19
20
|
spec.date = Date.today.to_s
|
20
21
|
spec.summary = "Improved logging for Ruby on Rails"
|
21
22
|
spec.description = "Replaces the default Rails logger with SemanticLogger"
|
22
|
-
spec.files = FileList["./**/*"].exclude(
|
23
|
+
spec.files = FileList["./**/*"].exclude(/\.gem$/, /\.log$/,/nbproject/).map{|f| f.sub(/^\.\//, '')}
|
24
|
+
spec.license = "Apache License V2.0"
|
23
25
|
spec.has_rdoc = true
|
24
|
-
spec.add_dependency 'semantic_logger', '>= 2'
|
25
|
-
spec.add_dependency 'rails', '>= 2'
|
26
|
+
spec.add_dependency 'semantic_logger', '>= 2.1'
|
27
|
+
#spec.add_dependency 'rails', '>= 2'
|
26
28
|
end
|
27
|
-
Gem::
|
29
|
+
Gem::Package.build gemspec
|
28
30
|
end
|
29
31
|
|
@@ -9,7 +9,7 @@ module RailsSemanticLogger #:nodoc:
|
|
9
9
|
# Claritybase::Application.configure do
|
10
10
|
# # Add the MongoDB logger appender only once Rails is initialized
|
11
11
|
# config.after_initialize do
|
12
|
-
# config.semantic_logger.
|
12
|
+
# config.semantic_logger.add_appender SemanticLogger::Appender::Mongo.new(
|
13
13
|
# :db => Mongo::Connection.new['development_development']
|
14
14
|
# )
|
15
15
|
# end
|
@@ -20,15 +20,13 @@ module RailsSemanticLogger #:nodoc:
|
|
20
20
|
# insert itself above the configured rails logger to add support for its
|
21
21
|
# additional features
|
22
22
|
#
|
23
|
-
# Also, if Mongoid is installed it will automatically start logging to Mongoid
|
24
|
-
#
|
25
23
|
# Loaded after Rails logging is initialized since SemanticLogger will continue
|
26
24
|
# to forward logging to the Rails Logger
|
27
25
|
initializer :initialize_semantic_logger, :before => :initialize_logger do
|
28
26
|
config = Rails.application.config
|
29
27
|
|
30
28
|
# Set the default log level based on the Rails config
|
31
|
-
SemanticLogger
|
29
|
+
SemanticLogger.default_level = config.log_level
|
32
30
|
|
33
31
|
# Existing loggers are ignored because servers like trinidad supply their
|
34
32
|
# own file loggers which would result in duplicate logging to the same log file
|
@@ -42,20 +40,20 @@ module RailsSemanticLogger #:nodoc:
|
|
42
40
|
# Set internal logger to log to file only, in case another appender
|
43
41
|
# experiences errors during writes
|
44
42
|
appender = SemanticLogger::Appender::File.new(path, config.log_level)
|
45
|
-
appender.name = "SemanticLogger
|
43
|
+
appender.name = "SemanticLogger"
|
46
44
|
SemanticLogger::Logger.logger = appender
|
47
45
|
|
48
46
|
# Add the log file to the list of appenders
|
49
|
-
SemanticLogger
|
50
|
-
SemanticLogger
|
47
|
+
SemanticLogger.add_appender(path)
|
48
|
+
SemanticLogger[Rails]
|
51
49
|
rescue StandardError
|
52
50
|
# If not able to log to file, log to standard error with warning level only
|
53
|
-
SemanticLogger
|
51
|
+
SemanticLogger.default_level = :warn
|
54
52
|
|
55
53
|
SemanticLogger::Logger.logger = SemanticLogger::Appender::File.new(STDERR)
|
56
|
-
SemanticLogger
|
54
|
+
SemanticLogger.add_appender(STDERR)
|
57
55
|
|
58
|
-
logger = SemanticLogger
|
56
|
+
logger = SemanticLogger[Rails]
|
59
57
|
logger.warn(
|
60
58
|
"Rails Error: Unable to access log file. Please ensure that #{path} exists and is chmod 0666. " +
|
61
59
|
"The log level has been raised to WARN and the output directed to STDERR until the problem is fixed."
|
@@ -64,9 +62,9 @@ module RailsSemanticLogger #:nodoc:
|
|
64
62
|
end
|
65
63
|
|
66
64
|
# Replace the default Rails loggers
|
67
|
-
ActiveSupport.on_load(:active_record) { self.logger = SemanticLogger
|
68
|
-
ActiveSupport.on_load(:action_controller) { self.logger = SemanticLogger
|
69
|
-
ActiveSupport.on_load(:action_mailer) { self.logger = SemanticLogger
|
65
|
+
ActiveSupport.on_load(:active_record) { self.logger = SemanticLogger['ActiveRecord'] }
|
66
|
+
ActiveSupport.on_load(:action_controller) { self.logger = SemanticLogger['ActionController'] }
|
67
|
+
ActiveSupport.on_load(:action_mailer) { self.logger = SemanticLogger['ActionMailer'] }
|
70
68
|
end
|
71
69
|
|
72
70
|
end
|
metadata
CHANGED
@@ -1,95 +1,66 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_semantic_logger
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
6
|
+
authors:
|
12
7
|
- Reid Morrison
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2013-04-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: semantic_logger
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
segments:
|
28
|
-
- 2
|
29
|
-
version: "2"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.1'
|
30
20
|
type: :runtime
|
31
|
-
version_requirements: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
name: rails
|
34
21
|
prerelease: false
|
35
|
-
|
36
|
-
requirements:
|
37
|
-
- -
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
|
40
|
-
- 2
|
41
|
-
version: "2"
|
42
|
-
type: :runtime
|
43
|
-
version_requirements: *id002
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.1'
|
44
27
|
description: Replaces the default Rails logger with SemanticLogger
|
45
|
-
email:
|
28
|
+
email:
|
46
29
|
- reidmo@gmail.com
|
47
30
|
executables: []
|
48
|
-
|
49
31
|
extensions: []
|
50
|
-
|
51
32
|
extra_rdoc_files: []
|
52
|
-
|
53
|
-
files:
|
33
|
+
files:
|
54
34
|
- Gemfile
|
55
|
-
-
|
56
|
-
- lib/rails_semantic_logger/version.rb
|
57
|
-
- lib/rails_semantic_logger.rb
|
35
|
+
- Gemfile.lock
|
58
36
|
- LICENSE.txt
|
59
|
-
- nbproject/private/private.properties
|
60
|
-
- nbproject/project.properties
|
61
|
-
- nbproject/project.xml
|
62
|
-
- Rakefile
|
63
37
|
- README.md
|
64
|
-
|
38
|
+
- Rakefile
|
39
|
+
- lib/rails_semantic_logger.rb
|
40
|
+
- lib/rails_semantic_logger/railtie.rb
|
41
|
+
- lib/rails_semantic_logger/version.rb
|
65
42
|
homepage: https://github.com/ClarityServices/rails_semantic_logger
|
66
|
-
licenses:
|
67
|
-
|
43
|
+
licenses:
|
44
|
+
- Apache License V2.0
|
45
|
+
metadata: {}
|
68
46
|
post_install_message:
|
69
47
|
rdoc_options: []
|
70
|
-
|
71
|
-
require_paths:
|
48
|
+
require_paths:
|
72
49
|
- lib
|
73
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
segments:
|
85
|
-
- 0
|
86
|
-
version: "0"
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
87
60
|
requirements: []
|
88
|
-
|
89
61
|
rubyforge_project:
|
90
|
-
rubygems_version:
|
62
|
+
rubygems_version: 2.0.2
|
91
63
|
signing_key:
|
92
|
-
specification_version:
|
64
|
+
specification_version: 4
|
93
65
|
summary: Improved logging for Ruby on Rails
|
94
66
|
test_files: []
|
95
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
file.reference.rails_semantic_logger-lib=/Users/rmorrison/Sandbox/rails_semantic_logger/lib
|
data/nbproject/project.xml
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project xmlns="http://www.netbeans.org/ns/project/1">
|
3
|
-
<type>org.netbeans.modules.ruby.rubyproject</type>
|
4
|
-
<configuration>
|
5
|
-
<data xmlns="http://www.netbeans.org/ns/ruby-project/1">
|
6
|
-
<name>rails_semantic_logger</name>
|
7
|
-
<source-roots>
|
8
|
-
<root id="src.dir"/>
|
9
|
-
</source-roots>
|
10
|
-
<test-roots/>
|
11
|
-
</data>
|
12
|
-
</configuration>
|
13
|
-
</project>
|