rails-client-logger 1.0.3 → 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec17c51fc62e6296c349ed741b377376eda5f3ed
|
4
|
+
data.tar.gz: e7a55613aec1b7ced63c720a581d19537e947063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20c584e85e52d9eeb873ec66c6e438f03aad8f6c1d34fc218050b17cfbe3e8e295c47f15b027c40756ba4ff9084fa4f0cfe0cd1c2b13427d932b697875d8400a
|
7
|
+
data.tar.gz: 4c4e6ac8b761b21b1f5274e965570aa0324909168d742cad22d673b109498453dc49542ec6180ad02cc7507c9386bd1ff7faffddb7b87a90c0498663348a9283
|
data/README.md
CHANGED
@@ -4,7 +4,10 @@ Rails engine to log from Client side (Browser) javascript to server log file. To
|
|
4
4
|
|
5
5
|
There are 5 levels of logging: debug, info, warn, error and fatal.
|
6
6
|
|
7
|
-
|
7
|
+
If [exception_notification](https://github.com/smartinez87/exception_notification) is found, sends
|
8
|
+
notifications for `error` and `fatal` levels.
|
9
|
+
|
10
|
+
Supports Rails 4 (permitted parameters).
|
8
11
|
|
9
12
|
For Rails 3.x use gem version `0.0.2`.
|
10
13
|
|
@@ -2,7 +2,11 @@ module RailsClientLogger
|
|
2
2
|
class RailsClientLoggersController < ApplicationController
|
3
3
|
def log
|
4
4
|
if %w(debug info warn error fatal).include?(params[:level].to_s)
|
5
|
-
|
5
|
+
level = params[:level].to_s.to_sym
|
6
|
+
Rails.logger.send(level, params[:message])
|
7
|
+
if defined? ExceptionNotifier
|
8
|
+
ExceptionNotifier.notify_exception(Exception.new(params[:message]), env: request.env) if level == :fatal or level == :error
|
9
|
+
end
|
6
10
|
head :ok
|
7
11
|
else
|
8
12
|
head :bad_request
|