You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Mark R. Diggory" <md...@latte.harvard.edu> on 2003/03/28 19:04:33 UTC

Another Default configuration not seeing my appender Question

Here's a similar question concerning an appenders error. I'm trying to 
launch a java program in Ant (Jelly) that uses log4j for logging. I do 
this via a target that looks somewhat like.

<target depends="compile" name="gui">
   <java classname="org.apache.commons.jelly.Jelly" fork="true" 
classpathref="classpath">
      <arg value="gui.xml"/>
      <sysproperty key="log4j.configuration" value="log4j.xml"/>
   </java>
</target>

I keep getting the errors that look like:

Buildfile: build.xml

gui:
      [java] log4j:WARN No appenders could be found for logger 
(org.apache.commons.jelly.parser.XMLParser).
      [java] log4j:WARN Please initialize the log4j system properly.


My config file looks like:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true">
    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
       <layout class="org.apache.log4j.PatternLayout">
          <param name="ConversionPattern" value="%-5p  - %m\n"/>
       </layout>
    </appender>
    <logger name="org" additivity="false">
       <level value="debug"/>
       <appender-ref ref="CONSOLE"/>
    </logger>
    <root>
       <priority value="debug"/>
       <appender-ref ref="CONSOLE"/>
    </root>
</log4j:configuration>

Is there something obvious that I'm missing here?

-Mark Diggory


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Another Default configuration not seeing my appender Question

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
Yup, that's the trick. I guess it makes sense, only jars are really 
directly referenced on the classpath.

By the way, on Windows2000/j2sdk1.4.* I was able to use Jakes "file:" 
url to get it working, Seems maybe its something with 1.4.* on windows.

<sysproperty key="log4j.configuration" value="file:./log4j.xml"/>

Thanks for the quick response to what was probibly a trival question!

-Mark

Ceki Gülcü wrote:
> 
> For starters, don't add the path to the file but the directory:
> 
> use C:/eclipse/workspace/project/ instead of 
> C:/eclipse/workspace/project/log4j.xml
> 
> At 01:16 PM 3/28/2003 -0500, you wrote:
> 
>> In the same directory as the build.xml (ant) and gui.xml (jelly) files 
>> I'm working with (thats why I'm trying to keep it relative).
>>
>> I've tried using the classpath to add the log4j.xml file but Ant's 
>> java task screams:
>>
>>      [java] CLASSPATH component 
>> C:\eclipse\workspace\project\log4j.xml: java.util.zip.ZipException: 
>> error in opening zip file
>>
>> But, I'm sure thats an issue that should be taken up on thier lists or 
>> Sun.
>>
>> -Mark
>>
>>
>> Ceki Gülcü wrote:
>>
>>> Hi Mark,
>>> Where is the log4j.xml file located?
>>> At 01:04 PM 3/28/2003 -0500, you wrote:
>>>
>>>> Here's a similar question concerning an appenders error. I'm trying 
>>>> to launch a java program in Ant (Jelly) that uses log4j for logging. 
>>>> I do this via a target that looks somewhat like.
>>>>
>>>> <target depends="compile" name="gui">
>>>>   <java classname="org.apache.commons.jelly.Jelly" fork="true" 
>>>> classpathref="classpath">
>>>>      <arg value="gui.xml"/>
>>>>      <sysproperty key="log4j.configuration" value="log4j.xml"/>
>>>>   </java>
>>>> </target>
>>>>
>>>> I keep getting the errors that look like:
>>>>
>>>> Buildfile: build.xml
>>>>
>>>> gui:
>>>>      [java] log4j:WARN No appenders could be found for logger 
>>>> (org.apache.commons.jelly.parser.XMLParser).
>>>>      [java] log4j:WARN Please initialize the log4j system properly.
>>>>
>>>>
>>>> My config file looks like:
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>>>> <log4j:configuration debug="true">
>>>>    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
>>>>       <layout class="org.apache.log4j.PatternLayout">
>>>>          <param name="ConversionPattern" value="%-5p  - %m\n"/>
>>>>       </layout>
>>>>    </appender>
>>>>    <logger name="org" additivity="false">
>>>>       <level value="debug"/>
>>>>       <appender-ref ref="CONSOLE"/>
>>>>    </logger>
>>>>    <root>
>>>>       <priority value="debug"/>
>>>>       <appender-ref ref="CONSOLE"/>
>>>>    </root>
>>>> </log4j:configuration>
>>>>
>>>> Is there something obvious that I'm missing here?
>>>>
>>>> -Mark Diggory
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>>>
>>> -- Ceki
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>>
> 
> -- 
> Ceki
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Another Default configuration not seeing my appender Question

Posted by Ceki Gülcü <ce...@qos.ch>.
For starters, don't add the path to the file but the directory:

use C:/eclipse/workspace/project/ instead of 
C:/eclipse/workspace/project/log4j.xml

At 01:16 PM 3/28/2003 -0500, you wrote:
>In the same directory as the build.xml (ant) and gui.xml (jelly) files I'm 
>working with (thats why I'm trying to keep it relative).
>
>I've tried using the classpath to add the log4j.xml file but Ant's java 
>task screams:
>
>      [java] CLASSPATH component C:\eclipse\workspace\project\log4j.xml: 
> java.util.zip.ZipException: error in opening zip file
>
>But, I'm sure thats an issue that should be taken up on thier lists or Sun.
>
>-Mark
>
>
>Ceki Gülcü wrote:
>>Hi Mark,
>>Where is the log4j.xml file located?
>>At 01:04 PM 3/28/2003 -0500, you wrote:
>>
>>>Here's a similar question concerning an appenders error. I'm trying to 
>>>launch a java program in Ant (Jelly) that uses log4j for logging. I do 
>>>this via a target that looks somewhat like.
>>>
>>><target depends="compile" name="gui">
>>>   <java classname="org.apache.commons.jelly.Jelly" fork="true" 
>>> classpathref="classpath">
>>>      <arg value="gui.xml"/>
>>>      <sysproperty key="log4j.configuration" value="log4j.xml"/>
>>>   </java>
>>></target>
>>>
>>>I keep getting the errors that look like:
>>>
>>>Buildfile: build.xml
>>>
>>>gui:
>>>      [java] log4j:WARN No appenders could be found for logger 
>>> (org.apache.commons.jelly.parser.XMLParser).
>>>      [java] log4j:WARN Please initialize the log4j system properly.
>>>
>>>
>>>My config file looks like:
>>>
>>><?xml version="1.0" encoding="UTF-8"?>
>>><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>>><log4j:configuration debug="true">
>>>    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
>>>       <layout class="org.apache.log4j.PatternLayout">
>>>          <param name="ConversionPattern" value="%-5p  - %m\n"/>
>>>       </layout>
>>>    </appender>
>>>    <logger name="org" additivity="false">
>>>       <level value="debug"/>
>>>       <appender-ref ref="CONSOLE"/>
>>>    </logger>
>>>    <root>
>>>       <priority value="debug"/>
>>>       <appender-ref ref="CONSOLE"/>
>>>    </root>
>>></log4j:configuration>
>>>
>>>Is there something obvious that I'm missing here?
>>>
>>>-Mark Diggory
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>>-- Ceki
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>

--
Ceki 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Another Default configuration not seeing my appender Question

Posted by "Mark R. Diggory" <md...@latte.harvard.edu>.
In the same directory as the build.xml (ant) and gui.xml (jelly) files 
I'm working with (thats why I'm trying to keep it relative).

I've tried using the classpath to add the log4j.xml file but Ant's java 
task screams:

      [java] CLASSPATH component C:\eclipse\workspace\project\log4j.xml: 
java.util.zip.ZipException: error in opening zip file

But, I'm sure thats an issue that should be taken up on thier lists or Sun.

-Mark


Ceki Gülcü wrote:
> 
> Hi Mark,
> 
> Where is the log4j.xml file located?
> 
> At 01:04 PM 3/28/2003 -0500, you wrote:
> 
>> Here's a similar question concerning an appenders error. I'm trying to 
>> launch a java program in Ant (Jelly) that uses log4j for logging. I do 
>> this via a target that looks somewhat like.
>>
>> <target depends="compile" name="gui">
>>   <java classname="org.apache.commons.jelly.Jelly" fork="true" 
>> classpathref="classpath">
>>      <arg value="gui.xml"/>
>>      <sysproperty key="log4j.configuration" value="log4j.xml"/>
>>   </java>
>> </target>
>>
>> I keep getting the errors that look like:
>>
>> Buildfile: build.xml
>>
>> gui:
>>      [java] log4j:WARN No appenders could be found for logger 
>> (org.apache.commons.jelly.parser.XMLParser).
>>      [java] log4j:WARN Please initialize the log4j system properly.
>>
>>
>> My config file looks like:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
>> <log4j:configuration debug="true">
>>    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
>>       <layout class="org.apache.log4j.PatternLayout">
>>          <param name="ConversionPattern" value="%-5p  - %m\n"/>
>>       </layout>
>>    </appender>
>>    <logger name="org" additivity="false">
>>       <level value="debug"/>
>>       <appender-ref ref="CONSOLE"/>
>>    </logger>
>>    <root>
>>       <priority value="debug"/>
>>       <appender-ref ref="CONSOLE"/>
>>    </root>
>> </log4j:configuration>
>>
>> Is there something obvious that I'm missing here?
>>
>> -Mark Diggory
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>>
> 
> -- 
> Ceki
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Another Default configuration not seeing my appender Question

Posted by Ceki Gülcü <ce...@qos.ch>.
Hi Mark,

Where is the log4j.xml file located?

At 01:04 PM 3/28/2003 -0500, you wrote:
>Here's a similar question concerning an appenders error. I'm trying to 
>launch a java program in Ant (Jelly) that uses log4j for logging. I do 
>this via a target that looks somewhat like.
>
><target depends="compile" name="gui">
>   <java classname="org.apache.commons.jelly.Jelly" fork="true" 
> classpathref="classpath">
>      <arg value="gui.xml"/>
>      <sysproperty key="log4j.configuration" value="log4j.xml"/>
>   </java>
></target>
>
>I keep getting the errors that look like:
>
>Buildfile: build.xml
>
>gui:
>      [java] log4j:WARN No appenders could be found for logger 
> (org.apache.commons.jelly.parser.XMLParser).
>      [java] log4j:WARN Please initialize the log4j system properly.
>
>
>My config file looks like:
>
><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
><log4j:configuration debug="true">
>    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
>       <layout class="org.apache.log4j.PatternLayout">
>          <param name="ConversionPattern" value="%-5p  - %m\n"/>
>       </layout>
>    </appender>
>    <logger name="org" additivity="false">
>       <level value="debug"/>
>       <appender-ref ref="CONSOLE"/>
>    </logger>
>    <root>
>       <priority value="debug"/>
>       <appender-ref ref="CONSOLE"/>
>    </root>
></log4j:configuration>
>
>Is there something obvious that I'm missing here?
>
>-Mark Diggory
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>

--
Ceki 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org