logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rakesh Patel" <Rakesh.Pa...@sharepeople.com>
Subject RE: Switching to XML configuration does not work
Date Mon, 10 Oct 2005 16:32:26 GMT
Hi,

Yep, did the trick. All working good!

Rakesh

-----Original Message-----
From: Jacob Kjome [mailto:hoju@visi.com] 
Sent: 10 October 2005 16:29
To: Log4J Users List
Subject: RE: Switching to XML configuration does not work


Quoting Rakesh Patel <Rakesh.Patel@sharepeople.com>:

> Hi,
>
> So I change to DOMConfigurator and find that its been deprecated in 
> 1.3. Ok, so I check the API and now I need to use the 
> JoranConfigurator. Finding an example is hard and eventually find a 
> testcase in the log4j cvs repository:
>
> JoranConfigurator jc = new JoranConfigurator();
>
> jc.doConfigure("c:/Projects/FETServer/conf/log4j.xml",
> LogManager.getLoggerRepository());
>
> Next problem - no sign of the SMTPAppender!!!! Its not in the latest 
> alpha release(6) but I can see it in the HEAD!!!! ARRRGGGHHH!!!!!! I 
> did actually compile my own but didn't include the mail stuff because 
> I didn't think I'd need it and that's why I switched back to alpha 6.
>

In Log4j-1.3, stuff depending on specific outside libraries such as
javamail were split into separate jars.  Look for something like
log4j-mail.jar (can't remember exactly what it is called, but it is
something like that).  So, it is probably there, you are just not
expecting it to be in a separate jar.  I'm not sure that the split of
jars will continue in future releases.  The developmental direction of
Log4j-1.3 has changed in recent months.

> So, do I now create my own compiled version of the latest code and 
> include it this time???
>

The latest alpha binary is probably very different than what is
currently in source control.  I would suggest either building yourself
(from the new SVN
source) or waiting a short time for the next build.  I believe Wednesday
is the scheduled date for the next alpha build to get released.


Jake

> Rakesh
>
> -----Original Message-----
> From: James Stauffer [mailto:stauffer.james@gmail.com]
> Sent: 10 October 2005 13:51
> To: Log4J Users List
> Subject: Re: Switching to XML configuration does not work
>
>
> Use DOMConfigurator.configure for XML files.
>
> On 10/10/05, Rakesh Patel <Rakesh.Patel@sharepeople.com> wrote:
> > Hi,
> >
> > Probably something basic but at present my testcase intialises log4j

> > like this and it works:
> >
> > PropertyConfigurator.configure("c:/Projects/FETServer/conf/log4j.pro
> > pe
> > rt
> > ies");
> >
> > Now I want to swap to XML file configuration (only because I could 
> > not
>
> > get SMTPAppender working and found xml examples!). So I changed the
> > code:
> >
> > PropertyConfigurator.configure("c:/Projects/FETServer/conf/log4j.xml
> > ")
> > ;
> >
> > However, there's no logging of my app anymore so I think its not 
> > finding the xml file.
> >
> > Anyone know whats wrong?
> >
> > Thanks
> >
> > Rakesh
> >
> > PS here's my log4j.xml file
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> >
> > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
> >
> >     <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
> >         <layout class="org.apache.log4j.PatternLayout">
> >             <param name="ConversionPattern"
> >                 value="%p - %C{1}.%M(%L) | %m%n"/>
> >         </layout>
> >     </appender>
> >
> >     <appender name="EMAIL" 
> > class="org.apache.log4j.net.SMTPAppender">
> >
> >                 <param name="Threshold" value="ERROR" />
> >                 <param name="To" 
> > value="rakesh.patel@sharepeople.com"
> />
> >                 <param name="From" 
> > value="rakesh.patel@sharepeople.com"
> > />
> >                 <param name="Subject"
> >                         value="Subject here" />
> >                 <param name="SMTPHost" value="195.110.64.110" />
> >
> >                 <layout class="org.apache.log4j.PatternLayout">
> >                         <param name="ConversionPattern"
> >                                 value="[%d{ISO8601}] %-5p %c %m %n"
/>
> >                 </layout>
> >
> >         </appender>
> >
> >     <logger name="org.apache.struts">
> >         <level value="WARN"/>
> >     </logger>
> >
> >     <logger name="org.apache.commons">
> >         <level value="WARN"/>
> >     </logger>
> >
> >     <logger name="net.sf.hibernate">
> >         <level value="WARN"/>
> >     </logger>
> >
> >         <logger name="my.apps.domain">
> >         <level value="WARN"/>
> >     </logger>
> >
> >     <root>
> >         <level value="WARN"/>
> >         <appender-ref ref="CONSOLE"/>
> >                 <appender-ref ref="EMAIL"/>
> >     </root>
> >
> > </log4j:configuration>
> >
> >
> >
> > American Express Investments and American Express Independent 
> > Financial Advisers are marketing names for American Express 
> > Financial Services Europe Limited, a separate corporation within the

> > American Express group of companies.  American Express Financial 
> > Services Europe Limited is authorised and regulated by, and is 
> > entered into the
>
> > register (No. 190853 www.fsa.gov.uk/register/) of, the Financial 
> > Services Authority and a member of the London Stock Exchange. 
> > Registered in England No. 3614902. Registered address: 230 
> > Blackfriars
>
> > Road, London SE1 8NW. Vat No. 740 4143 68.
> >
> > The information in this email and any attachments is confidential 
> > and intended solely for the attention and use of the named 
> > addressee(s). It may be subject to legal, professional or other 
> > privilege and further distribution of it is strictly prohibited 
> > without our authority.  If you are not the intended recipient, you 
> > are not authorised to and must not disclose, copy, distribute, or 
> > retain this message or any part of it, and should notify us 
> > immediately.
> >
> >
> >
>
>
> --
> James Stauffer
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
> American Express Investments and American Express Independent 
> Financial Advisers are marketing names for American Express Financial 
> Services Europe Limited, a separate corporation within the American 
> Express group of companies.  American Express Financial Services 
> Europe Limited is authorised and regulated by, and is entered into the

> register (No. 190853
> www.fsa.gov.uk/register/) of, the Financial Services Authority and a
member
> of the London Stock Exchange. Registered in England No. 3614902.
Registered
> address: 230 Blackfriars Road, London SE1 8NW. Vat No. 740 4143 68.
>
> The information in this email and any attachments is confidential and 
> intended solely for the attention and use of the named addressee(s). 
> It may be subject to legal, professional or other privilege and 
> further distribution of it is strictly prohibited without our 
> authority.  If you are not the intended recipient, you are not 
> authorised to and must not disclose, copy, distribute, or retain this 
> message or any part of it, and should notify us immediately.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>




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



American Express Investments and American Express Independent Financial Advisers are marketing
names for American Express Financial Services Europe Limited, a separate corporation within
the American Express group of companies.  American Express Financial Services Europe Limited
is authorised and regulated by, and is entered into the register (No. 190853 www.fsa.gov.uk/register/)
of, the Financial Services Authority and a member of the London Stock Exchange. Registered
in England No. 3614902. Registered address: 230 Blackfriars Road, London SE1 8NW. Vat No.
740 4143 68. 

The information in this email and any attachments is confidential and intended solely for
the attention and use of the named addressee(s). It may be subject to legal, professional
or other privilege and further distribution of it is strictly prohibited without our authority.
 If you are not the intended recipient, you are not authorised to and must not disclose, copy,
distribute, or retain this message or any part of it, and should notify us immediately.


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


Mime
View raw message