chewbranca commented on code in PR #4483:
URL: https://github.com/apache/couchdb/pull/4483#discussion_r1149886018
##########
src/couch_log/src/couch_log_formatter.erl:
##########
@@ -365,9 +380,29 @@ format_args([H | T], FmtAcc, ArgsAcc) ->
{Str, _} = couch_log_trunc_io:print(H, 100),
format_args(T, ["~s" | FmtAcc], [Str | ArgsAcc]).
-maybe_truncate(Fmt, Args) ->
+maybe_truncate("", [], Meta, TruncateMeta) ->
+ MaxMsgSize = couch_log_config:get(max_message_size),
+ case format_meta(Meta) of
+ "" ->
+ "";
+ MetaStr when TruncateMeta and length(MetaStr) > MaxMsgSize ->
+ %% TODO: what to do when meta formatted data is too large?
Review Comment:
In 8f3aabe2c I've switched over to `couch_log:report` returning true or
false on successful report when the message is within bounds, and I've added a
metric counter `couch_log.level.report_error` to track the error on too long of
messages. My rationale is that we're not going to log data about the entry that
was too long to be logged, so introducing a log message won't provide
additional insight over a counter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]