I want to update logback.xml in java programmatically, I tried to update sing DOM API but got an exception
Exception in thread "main" org.w3c.dom.DOMException: NO_MODIFICATION_ALLOWED_ERR: An attempt is made to modify an object where modifications are not allowed.
at com.sun.org.apache.xerces.internal.dom.ParentNode.internalInsertBefore(ParentNode.java:351)
at com.sun.org.apache.xerces.internal.dom.ParentNode.insertBefore(ParentNode.java:288)
at com.sun.org.apache.xerces.internal.dom.NodeImpl.appendChild(NodeImpl.java:238)
at XMLUtils.add(XMLUtils.java:49)
Java Result: 1
Can anyone tell me how to solve this issue, and is that any possibility to achieve this via logback API.