@@ -79,30 +79,17 @@ public void setup() {
7979 rootLogger .getAttributes ().put ("level" , "INFO" );
8080 loggers .getChildren ().add (rootLogger );
8181
82- // Add Properties Node only if the map is not null and has entries
83- if (map != null && !map .isEmpty ()) {
82+ if (map != null ) {
8483 final Node properties = newNode (rootNode , "Properties" );
8584 rootNode .getChildren ().add (properties );
8685
8786 for (final Entry <String , String > entry : map .entrySet ()) {
88- // Create Property node with "name" and "value" attributes
8987 final Node property = newNode (properties , "Property" );
9088 property .getAttributes ().put ("name" , entry .getKey ());
9189 property .getAttributes ().put ("value" , entry .getValue ());
9290 properties .getChildren ().add (property );
9391 }
9492 }
95-
96- // Add a Scripts Node if required (Example for flexibility in testing)
97- final Node scripts = newNode (rootNode , "Scripts" );
98- rootNode .getChildren ().add (scripts );
99-
100- // Add sample script node for testing purposes
101- final Node script = newNode (scripts , "Script" );
102- script .getAttributes ().put ("name" , "TestScript" );
103- script .getAttributes ().put ("language" , "JavaScript" );
104- script .getAttributes ().put ("scriptText" , "print('Hello, Log4j!');" );
105- scripts .getChildren ().add (script );
10693 }
10794
10895 private Node newNode (final Node parent , final String name ) {
0 commit comments