1

I'm wondering if this already exists, or if I need to implement it myself. I'd basically like to be able to update the contents of an existing logback.xml programatically.

carlspring
  • 31,231
  • 29
  • 115
  • 197

1 Answers1

1

There is a project in github which aims to provide an XML Schema definition for the logback configuration file. You can work from there to create a parser/writer with JAXB or Castor or your prefered XML Library.

Roberto Linares
  • 2,215
  • 3
  • 23
  • 35
  • Why isn't this just contributed back to the logback project...? So... what -- I need something like the `maven-jaxb2-plugin` to generate the classes for me based on the XSD? Is there really no other way? I was expecting `logback` to be a bit more mature of a project, based on the fact that I've already seen this sort of functionality in a number of products? Did they all just have to knock up their own implementations? – carlspring Oct 17 '14 at 00:50
  • Well, according to [this question's answer](http://stackoverflow.com/questions/5731162/xml-schema-or-dtd-for-logback-xml) and its links, Logback dev team considered the XML configuration file too flexible to specify an XML Schema or DTD for it. – Roberto Linares Oct 17 '14 at 15:09