Formatter Concatenates Messages in logger.info('message1', {message: 'message2'})
#1634
Closed
1 of 2 tasks
Please tell us about your environment:
winston
version?winston@2
winston@3
Specifically, I'm using winston 3.2.1 because I wanted these fixes: Better handling ofnew Error(string)
throughout the pipeline(s). Fixes #1338, #1486 #1562node -v
outputs: v8.15.0What is the problem?
In the callback of the
printf
formatter below, in theinfo
object, the value ofinfo.message
is my "log message" (see below) and "object message" (or "error message" as in the 2nd case) concatenated directly together (e.g.log messageobject message
).What do you expect to happen instead?
Depends on what the community thinks. Here are some options for the value of
info.message
:I like option 1, but I recognize this is a bit fancy and might catch users of this library by surprise.
Other information
I also tested and found this same type of issue occurring with the following formatters:
json
,logstash
,printf
,prettyPrint
,simple
. I did not test any other formatters (I don't know if other formatters even exist).Lastly, I recognize that this might be an issue not with
winstonjs/winston
but actually an issue withwinstonjs/logform
. If that is the case, I apologize. I took a brief look at the code today to figure out in which would be the correct repo to post this issue, but I could not make a determination. If someone says this is an issue with a different repo (e.g.winstonjs/logform
) just LMK and I'll close this issue here and move it to the appropriate repo.The text was updated successfully, but these errors were encountered: