Forum: Building VoltDB Applications

Post: Logging Config Errors

Logging Config Errors
shetty_ritesh
Apr 21, 2010
I used the log4j.xml for logging the various events . The log4j is as given below .

<?xml version="1.0" encoding="UTF-8" ?>


When i compile the project to build the catalog the build is sucessfull but the log4j throws error as given below ...
All log4j related classes are in the voldb.jar bundled in the distribution. If it is able to get voltdb related jars then it should also get al lthe log4j related jars. Any other jars i needs to have in my classapth ?


atalog:
[java] log4j:WARN Continuable parsing error 10 and column 46
[java] log4j:WARN Attribute "class" is required and must be specified for element type "layout".
[java] log4j:WARN Continuable parsing error 10 and column 46
[java] log4j:WARN Attribute "type" must be declared for element type "layout".
[java] log4j:WARN Continuable parsing error 16 and column 48
[java] log4j:WARN Attribute "class" is required and must be specified for element type "layout".
[java] log4j:WARN Continuable parsing error 16 and column 48
[java] log4j:WARN Attribute "type" must be declared for element type "layout".
[java] log4j:WARN Continuable parsing error 57 and column 23
[java] log4j:WARN The content of element type "log4j:configuration" must match "(renderer*,appender*,plugin*,(category|logger)*,root?,(categoryFactory|loggerFactory)?)".
[java] log4j:ERROR Could not create the Layout. Reported error follows.
[java] java.lang.ClassNotFoundException:
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:169)
[java] at org.apache.log4j.helpers.Loader.loadClass(Loader.java:179)
[java] at org.apache.log4j.xml.DOMConfigurator.parseLayout(DOMConfigurator.java:534)
[java] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:259)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
[java] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:274)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
[java] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
[java] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)
[java] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)
[java] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
[java] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
[java] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
[java] at org.apache.log4j.LogManager.(LogManager.java:125)
[java] at org.apache.log4j.Logger.getRootLogger(Logger.java:136)
[java] at org.voltdb.utils.VoltLoggerFactory.(VoltLoggerFactory.java:48)
[java] at org.voltdb.compiler.VoltCompiler.(VoltCompiler.java:113)
[java] log4j:ERROR Could not create the Layout. Reported error follows.
[java] java.lang.ClassNotFoundException:
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:169)
[java] at org.apache.log4j.helpers.Loader.loadClass(Loader.java:179)
[java] at org.apache.log4j.xml.DOMConfigurator.parseLayout(DOMConfigurator.java:534)
[java] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:259)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
[java] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:274)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:171)
[java] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:184)
[java] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:502)
[java] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:471)
[java] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:921)
[java] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:790)
[java] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
[java] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
[java] at org.apache.log4j.LogManager.(LogManager.java:125)
[java] at org.apache.log4j.Logger.getRootLogger(Logger.java:136)
[java] at org.voltdb.utils.VoltLoggerFactory.(VoltLoggerFactory.java:48)
[java] at org.voltdb.compiler.VoltCompiler.(VoltCompiler.java:113)
[java] No logging configuration supplied via -Dlog4j.configuration. Supplying default config that logs to INFO or higher to STDOUT
[java] 8 [main] INFO COMPILER - Catalog leader: localhost hosts, sites 1, 1
[java]
[java] ** BEGIN PROJECT COMPILE: project.xml **
Logging Config Errors
aweisberg
Apr 22, 2010
Hi Shetty,

Is "<?xml version="1.0" encoding="UTF-8" ?> " the complete log4j config file? How are you specifying that log4j should use that config file?


-Ariel
No Actually i pasted the
shetty_ritesh
Apr 22, 2010
No Actually i pasted the whole xml but it did not save it i guess. I tried again and preview also doesnt show it.

But you can take the log4j.xml from UsingVoltDB.pdf . I have the exact same xml. I can mai lit to you alternatively.
XML config errors
aweisberg
Apr 22, 2010
Hi,
There were some bugs in the XML. The format for log4j xml files is in log4j.dtd. I will get a the UsingVoltDB document corrected.
Diff

11,12c11,12
< <layout type="org.apache.log4j.TTCCLayout">
< </layout>
---
> <layout class="org.apache.log4j.TTCCLayout" >
> </layout>
17c17,18
< <layout type="org.apache.log4j.TTCCLayout" />
---
> <layout class="org.apache.log4j.TTCCLayout" >
> </layout>
19,22d19
< <root>
< <priority value="debug" />
< <appender-ref ref="Async" />
< </root>
56,58c53,57
<
<
< </log4j:configuration>
\ No newline at end of file
---
> <root>
> <priority value="debug" />
> <appender-ref ref="Async" />
> </root>
> </log4j:configuration>

Original
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="Async" class="org.apache.log4j.AsyncAppender">

<param name="Blocking" value="true" />

<appender-ref ref="Console" />

<appender-ref ref="File" />

</appender>

<appender name="Console" class="org.apache.log4j.ConsoleAppender">

<param name="Target" value="System.out" />

<layout type="org.apache.log4j.TTCCLayout">

</layout>

</appender>

<appender name="File" class="org.apache.log4j.FileAppender">

<param name="File" value="/tmp/voltdb.log" />

<param name="Append" value="true" />

<layout type="org.apache.log4j.TTCCLayout" />

</appender>

<root>

<priority value="debug" />

<appender-ref ref="Async" />

</root>



<logger name="AUTH"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>

<logger name="HOST"> <!-- Print all VoltDB HOST messages -->

<level value="trace" />

</logger>

<logger name="CLUSTER"> <!-- Print all VoltDB CLUSTER messages -->

<level value="trace" />

</logger>

<logger name="STORAGE"> <!-- Print all VoltDB STORAGE messages -->

<level value="trace" />

</logger>



<logger name="SQL"> <!-- Print all VoltDB SQL messages -->

<level value="trace" />

</logger>



<logger name="TRANSACTIONS"> <!-- Print all VoltDB TRANSACTIONS messages -->

<level value="trace" />

</logger>



<logger name="NETWORK"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>



<logger name="CLUSTER"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>



<logger name="COMPILER"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>





</log4j:configuration>

Corrected
<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="Async" class="org.apache.log4j.AsyncAppender">

<param name="Blocking" value="true" />

<appender-ref ref="Console" />

<appender-ref ref="File" />

</appender>

<appender name="Console" class="org.apache.log4j.ConsoleAppender">

<param name="Target" value="System.out" />

<layout class="org.apache.log4j.TTCCLayout" >

</layout>
</appender>

<appender name="File" class="org.apache.log4j.FileAppender">

<param name="File" value="/tmp/voltdb.log" />

<param name="Append" value="true" />

<layout class="org.apache.log4j.TTCCLayout" >

</layout>
</appender>



<logger name="AUTH"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>

<logger name="HOST"> <!-- Print all VoltDB HOST messages -->

<level value="trace" />

</logger>

<logger name="CLUSTER"> <!-- Print all VoltDB CLUSTER messages -->

<level value="trace" />

</logger>

<logger name="STORAGE"> <!-- Print all VoltDB STORAGE messages -->

<level value="trace" />

</logger>



<logger name="SQL"> <!-- Print all VoltDB SQL messages -->

<level value="trace" />

</logger>



<logger name="TRANSACTIONS"> <!-- Print all VoltDB TRANSACTIONS messages -->

<level value="trace" />

</logger>



<logger name="NETWORK"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>



<logger name="CLUSTER"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>



<logger name="COMPILER"> <!-- Print all VoltDB authentication messages -->

<level value="trace" />

</logger>

<root>
<priority value="debug" />
<appender-ref ref="Async" />
</root>
</log4j:configuration>

-Ariel