简体   繁体   中英

Apache Commons Logging - New Line Characters

We are using apache commons logging in our application for all our logging requirements. A funny use case popped up this week that I had a question about. We started receiving FIX messages from clients where a particular field in the fix message is populated based on the values in a free form textarea on an application that our client has. The client is allowed to enter in any text they want including special characters and new lines etc.

We log the fix message we receive back but when we receive a FIX message that includes this tag that has new line characters in it, only the part of the fix message up until the new line character is logged. Is there anyway to tell the logging framework to ignore new line characters and log the entire string whether or not it contains new line characters?

are you sure the message isn't being logged on a new line? We do a similar thing and new lines are logged without any extra configuration. Are you grep'ing for these lines in the log to view them? I ask because they will show on a new line, and therefore not in the output of grep unless you add '-A 5' (or how many lines you want to see after) flag to your grep statement to see the new lines after the matching one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM