Die meistgefragten Interviewfragen und Antworten sowie Online-Tests
Lernplattform fur Interviewvorbereitung, Online-Tests, Tutorials und Live-Ubungen

Baue deine Fahigkeiten mit fokussierten Lernpfaden, Probetests und interviewreifem Inhalt aus.

WithoutBook vereint themenbezogene Interviewfragen, Online-Ubungstests, Tutorials und Vergleichsleitfaden in einem responsiven Lernbereich.

Interview vorbereiten

Probeprufungen

Als Startseite festlegen

Diese Seite als Lesezeichen speichern

E-Mail-Adresse abonnieren

Without Book Frage stellen

Frage. log4j.xml or log4j.properties in java log configuration.

- Which one I should prefer - log4j.xml or log4j.properties to configure log in my java app.

Veroffentlicht am Jul 23, 2014 Veroffentlicht von Ruby Singh
Antwort. Properties can be defined by a properties file or by an XML file. Log4j looks for a file named log4j.xml and then for a file named log4j.properties. Both must be placed in the src folder.

The property file is less verbose than an XML file. The XML requires the log4j.dtd to be placed in the source folder as well. The XML requires a dom4j.jar which might not be included in older Java versions.

The properties file does not support some advanced configuration options like Filters, custom ErrorHandlers and a special type of appenders, i.e. AsyncAppender. ErrorHandlers defines how errors in log4j itself are handled, for example badly configured appenders. Filters are more interesting. From the available filters, I think that the level range filter is really missing for property files.
Veroffentlicht am Jul 26, 2014 Veroffentlicht von Johny Verma

Geben Sie Ihre Antwort ein

Vollstandiger Name
E-Mail-Adresse
Antwort
Sicherheitsprufung
Lose dies, um fortzufahren: 9 + 4 = ?
Copyright © 2026, WithoutBook.