Hi,

so there exists somewhere a log4j.dtd, which describes the configuration 
file, is it correct? If yes, where can I find the DTD?

Thanks for your help and kind regards,
Andreas




-- 
Andreas Grund
externer Mitarbeiter Projet GUTS bei Conti
mailto:[EMAIL PROTECTED]
Mobile:




Germany

Phone:
Fax:



Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672


  -----Ursprüngliche Nachricht-----

Von: Curt Arnold [mailto:[EMAIL PROTECTED]
Gesendet: Di 12.02.2008 16:01
An: Log4J Users List
Betreff: Re: async appender does not log caller infos


On Feb 12, 2008, at 5:14 AM, Andreas Grund wrote:

> Hi mailing-list,
>
> is it correct, that the org.apache.log4j.AsyncAppender does not log
> caller
> information like caller_filename or caller_class? Or may that base
> on a
> configuration error in my log4j configuration?
> Here is my configuration:
> The appender:
> <appender name="DB" class="org.apache.log4j.db.DBAppender">
>       <param name="locationInfo" value="true"/>
>       <connectionSource
> class="org.apache.log4j.db.DriverManagerConnectionSource">
>         <param name="driverClass"
> value="oracle.jdbc.driver.OracleDriver"/>
>         <param name="url"
> value="jdbc:oracle:thin:@localhost:1521:GUTSMQ"/>
>         <param name="user" value="System"/>
>         <param name="password" value="gutsmq"/>
>       </connectionSource>
>  </appender>
>
>  <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>       <appender-ref ref="DB" />
>  </appender>
>
> the logger:
> <logger name="org.apache.log4j.joran"><level value="INFO" /></logger>
>  <logger name="org.apache.log4j.config"><level value="INFO" /></
> logger>
>  <logger name="org.apache.log4j.db"><level value="INFO" /></logger>
>
>  <root>
>    <level value ="debug"/>
>    <appender-ref ref="ASYNC" />
>  </root>
>

Acquiring the caller's location is time consuming and must be done
before the request is placed in the queue, so it is optional.  If you
want the AsyncAppender to acquire the caller's location, add

>  <appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
>       <appender-ref ref="DB" />
            <param name="locationInfo" value="true"/>
>
>  </appender>




> NTW: is there anywhere a schema file for the xml configuration file?
>

Unfortunately, log4j's configuration format has a weird mix of
namespace qualified and non-namespace qualified elements.  If you were
to write a schema for the existing configuration format, you would
need to write one XSD file for the "http://jakarta.apache.org/log4j/";
namespace which contains the configuration element and a non-namespace
qualified schema for all the other elements.   If you did that, it
would give you the XML equivalent of a weakly typed language, it would
only detect gross structural errors.  It wouldn't be an improvement
over the log4j.dtd which is the appropriate validation technology for
XML documents that aren't namespace aware.

There was an attempt to define a new configuration file format that
was documented and strongly typed, however that effort stalled for
lack of participation.  If and when log4j 2.0 development starts, the
likely approach would be to replace the existing configuration code
with some configuration project and support the existing formats with
transforms to the new format.

> Thanks for your help and kind regards,
> Andreas
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to