Comments (7)
Are you using Semantic Logger or Rails Semantic Logger?
Rails Version?
Semantic Logger Version?
Rails Semantic Logger Version?
Ruby Version?
Rails configuration, specifically all settings related to Rails Semantic Logger and Semantic Logger.
from semantic_logger.
Rails 4.2.8
Rails Semantic Logger 4.0.1
Semantic Logger 4.0.0
Ruby 2.3.1
# config/environments/production.rb
#...
config.log_level = :info
config.log_errors_to_sentry = true
config.paths['log'] = "/var/log/our-project/#{Rails.env}.log"
config.colorize_logging = false
config.rails_semantic_logger.quiet_assets = true
# config/initializers/logging.rb
include SemanticLogger::Loggable
# based on https://github.com/rocketjob/semantic_logger/blob/0f047df6019a14dcd2c05cac9cbfbf38f0a24461/lib/semantic_logger/formatters/default.rb
# only small modification of log level to show DEBUG/WARN instead of D/W/...
module SemanticLogger
module Formatters
class Kenhub < Base
# Default text log format
# Generates logs of the form:
# 2011-07-19 14:36:15.660235 D [1149:ScriptThreadProcess] Rails -- Hello World
def call(log, logger)
# Date & time
message = time_format.nil? ? '' : "#{format_time(log.time)} "
# Log level and process info
message << "#{log.level.upcase} [#{log.process_info}]"
# Tags
message << ' ' << log.tags.collect { |tag| "[#{tag}]" }.join(' ') if log.tags && (log.tags.size > 0)
# Named Tags
if (named_tags = log.named_tags) && !named_tags.empty?
list = []
named_tags.each_pair { |name, value| list << "[#{name}: #{value}]" }
message << ' ' << list.join(' ')
end
# Duration
message << " (#{log.duration_human})" if log.duration
# Class / app name
message << " #{log.name}"
# Log message
message << " -- #{log.message}" if log.message
# Payload
if payload = log.payload_to_s
message << ' -- ' << payload
end
# Exceptions
if log.exception
message << " -- Exception: #{log.exception.class}: #{log.exception.message}\n"
message << log.backtrace_to_s
end
message
end
end
end
end
if Kenhub.config.log_errors_to_sentry
SemanticLogger.add_appender(:appender => :sentry, :level => :error)
end
unless Kenhub.config.colorize_logging
appender = SemanticLogger.appenders.find{ |a| a.is_a?(SemanticLogger::Appender::File) }
appender.formatter = SemanticLogger::Formatters::Kenhub.new
end
from semantic_logger.
Should be fixed in Rails Semantic Logger v4.1 that will be released as soon as reidmorrison/rails_semantic_logger#36 has been merged. The fragment logging is now controlled by ActionController::Base.enable_fragment_cache_logging
.
from semantic_logger.
Give v4.1 a try. Please re-open this ticket if it still logs the above messages.
from semantic_logger.
Will do. Thanks @reidmorrison. So 4.1 is officially out ?
from semantic_logger.
hmmm... I'm getting this error
NoMethodError: undefined method `enable_fragment_cache_logging=' for ActionController::Base:Class
from semantic_logger.
seeing other errors after upgrading... check out reidmorrison/rails_semantic_logger#38
from semantic_logger.
Related Issues (20)
- Default formatter doesn't return context by default. HOT 1
- Semantic Logger removes keys from hash passed to loggers
- Support message and payload (v5 feature request) HOT 7
- Cannot use Sentry.init properly with sentry-ruby appender HOT 2
- Add support for New Relic log forwarding feature HOT 9
- Elasticsearch Specifying types in bulk requests is deprecated HOT 4
- Log level signal trap omits :fatal and :error levels HOT 2
- Suggestion: Change Loggable logger initialization from lazy to eager HOT 5
- RSpec test suite hangs intermittently unless `sync!` has been called HOT 1
- SemanticLogger.sync! is Not Thread-Safe
- Semantic Logger + Sidekiq 7 HOT 3
- Exception on `logger.error({ payload: '', foo: 'bar' })` (trying to log an arbitrary hash with `payload` key) HOT 1
- HTTP appender / Possible to write custom Headers HOT 1
- Segmentation fault in Formatters::Base for async appender HOT 2
- Improve CaptureLogEvents test logger HOT 1
- Error is raised when logging first occurs in a signal trap
- Base formatter time_format docs and behavior conflict, with no way to initialize it to nil in the ctor.
- Calling 'reopen' and Adding an Appender Creates 2 Logging Threads HOT 2
- Release Version 4.13 HOT 1
- Intermittent `NameError`/`LoadError` when loading Rails environment HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semantic_logger.