• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

How to add line breaks in SOAP response logged by Log4j?

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I set up my log4j:configuration file:

In my console and log file i receive next logged response from server. It looks like :

TRACE: [may-15 16:41:04,341] server.MessageTracing.sent - Sent response [<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body>a long, long unformated string without any line breaks</SOAP-ENV:Body></SOAP-ENV:Envelope>] for request ......

The question is: how to add pretty format with line breaks between xml tags in logged soap response? Does log4j support this feature?

Posts: 10445
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maya, welcome to CodeRanch!

Log4j doesn't play a role here since the original message being logged (from some library) itself doesn't have the necessary formatting in that text. You'll have to check who is logging that message and probably change the code to format the message being logged, before passing that message to the logger.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic