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 Switching to XML configuration does not work
Date Mon, 10 Oct 2005 12:01:02 GMT

Probably something basic but at present my testcase intialises log4j
like this and it works:


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


However, there's no logging of my app anymore so I think its not finding
the xml file.

Anyone know whats wrong?



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"/>
    <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="" />
		<layout class="org.apache.log4j.PatternLayout">
			<param name="ConversionPattern"
				value="[%d{ISO8601}] %-5p %c %m %n" />

    <logger name="org.apache.struts">
        <level value="WARN"/>
    <logger name="org.apache.commons">
        <level value="WARN"/>

    <logger name="net.sf.hibernate">
        <level value="WARN"/>

	<logger name="my.apps.domain">
        <level value="WARN"/>

        <level value="WARN"/>
        <appender-ref ref="CONSOLE"/>
		<appender-ref ref="EMAIL"/>


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.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message