Replies: 1 comment
-
Planning on including this feature in Semantic Logger v5: reidmorrison/semantic_logger#203 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It's a common practice for production apps to write logs to stdout (e.g. for log entries that are at levels less severe than warning) or stderr (e.g. for warning/error/fatal levels) however I am not sure how to implement this with the current version of rails_semantic_logger.
Per the changelog, in v4.8.0+ a check was apparently added to
appenders.rb
: "Prevent multiple console (stdout or stderr) appenders from being added". It doesn't seem to care if what is being written to stdout and stderr are mutually exclusive.Running the following example in a Rails app using the current version of rails_semantic_logger, the following error is produced: SemanticLogger::Appenders -- Ignoring attempt to add a second console appender: SemanticLogger::Appender::IO since it would result in duplicate console output
My understanding is that without this built-in block, I could otherwise use the
filter
argument ofadd_appender
to ensure that appenders for the respective$stdout
and$stderr
are don't overlap, and that no log entries would be duplicated in console output.Please advise if there's a good way to handle this case, or if perhaps this would be better classified as a bug/issue. If there's a reason you don't think it matters and that I should log everything to stdout I'd be interested to know why??
Beta Was this translation helpful? Give feedback.
All reactions