This is my log4jproperties.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/' > ... </log4j:configuration> The logging works, but when I open the xml-file in IE6 I get the following error: Reference to undeclared Namespace-Pr�fix: 'log4j'. line 3, column 1 I try several example files, but all produces the same error. I changed the log4j.dtd too. Any Suggestions? mfg Franz Degenhardt
Hi Folks! I visited nearly every google result for log4j! I found several example config files. All produces the same error as above. The few that works doesnt implement the log4j.dtd, so no wonder that all works. I looked over the dtd too. All seams to be ok. So what is it? There are about 20 Mirrors off the log4j-api. All with broken links to examples! Any other suggestions to get a working xml-config file including the dtd? Franz Degenhardt
Hello! Thanks for your answer. It is atm. Otherwise I got: "cant find resource log4j.dtd" I found several config-files in the internet, but those which produces no errors have the doctype statement missing. If I leave it out too, it works correkt. But thats not what I want, as you can imagine. Franz Degenhardt
There is one thing. Be sure to place the .dtd file in the exactly the same directory as the config file and not in a subdirectory like 'org.apache....'. If it is, i can't help you... (Try to download latest version of log4j. It is backwards compatible.... )
"...you've got to ask yourself one question, Do I feel lucky?"
I made that sure. I downloaded an aktuell version, too. Same error as described above. My configuration is working properly, but there is still the bug, that I cant view the config.xml in a browser like IE6. Do you have a working config-file with a correct doctype-statement? I would be interressted. Franz Degenhardt
Well, even with your file, I got still the same error: Reference to undeclared namespacepr�fix: 'log4j'. line 3, position 1 <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> ^ Are you able to open your file in a browser without errors? Franz Degenhardt
Sorry this is kind of gigantic but here it is. This one works. In WSAD it does not like not having specific end tags on the Param lines. This also shows you how to do 2 output targets. I like logging to both a Socket for Chainsaw and to a file.
Isn't the problem really that the log4j folks are using the namespaces in a strange way? The standard root element is log4j:configuration and the namespace for the log4j prefix is declared. But there is no declaration for the default empty namespace which all the other elements use. It seems strange. When I set the default namespace to the same namespace url the system still complains.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop