ogjunk-log4j | 1 Apr 2004 01:14
Picon
Favicon

ERR/WARN: DOM element, No appenders found, etc.

Hello,

According to the Short Manual for Log4J, using log4j.configuration
system property to specify the log4j config file location is the way to
go.

When I do that: java -Dlog4j.configuration=./log4j.xml com.example.Foo 

I get:

log4j:ERROR DOM element is - not a <log4j:configuration> element.
log4j:WARN No appenders could be found for logger (com.example.Foo).
log4j:WARN Please initialize the log4j system properly.

I checked my log4j.xml, and it starts with:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<!-- $Id: log4j.xml,v 1.3 2004/03/30 03:17:52 otis Exp $ -->

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

    <appender ..........

I am using Log4J 1.2.8 and I see that my log4j-1.2.8.jar has log4j.dtd
in it.

Any idea why I am getting that error and warning above?
(Continue reading)

Alan Brown | 1 Apr 2004 02:10

RE: Static log reading tool...

My problem was localized enough that I was able to write a tool to do it
in an hour.  I plan to make it a bit more generic though when I return
from my vacation and I'll be happy to look at integrating my desired
functionality in chainsaw if you'd like.

alan

-----Original Message-----
From: Paul Smith [mailto:paul.smith <at> lawlex.com.au] 
Sent: Tuesday, March 30, 2004 3:05 PM
To: Log4J Users List
Cc: log4j-dev <at> logging.apache.org
Subject: RE: Static log reading tool...

On Wed, 2004-03-31 at 08:51, Alan Brown wrote:
> Can Chainsaw go to remote locations (specified as virtual drives so I
> guess that won't be a problemm) and read the file I specify into
> chainsaw, filtering out the parts that don't meet it's criteria.
> 

You can open a remote XMLLayout formatted file by using a URL (e.g
file://mnt/mydrive/.... or http://myserver/logs/log.xml) by using the
menu item under the File menu.

Once you have read in the file, a tab is created based an a unique name
(configured from the app preferences).  Chainsaw v2 will remember as
preferences the logger filters you use in the Log Tree panel on the
left, but I am not sure we've got around to storing remembered filter
expressions yet.  But you could paste in the filter expression you
created previously I guess until we get around to it.
(Continue reading)

haggaic2v7-loguser | 1 Apr 2004 08:36
Picon
Favicon

Re: ERR/WARN: DOM element, No appenders found, etc.

This is a simple mistake I've made many a time before.  The value of
log4j.configuration needs to be a URL.  So the following will work:

java -Dlog4j.configuration=file:./log4j.xml

-Ian

--- ogjunk-log4j <at> yahoo.com wrote:
> Hello,
> 
> According to the Short Manual for Log4J, using log4j.configuration
> system property to specify the log4j config file location is the way
> to
> go.
> 
> When I do that: java -Dlog4j.configuration=./log4j.xml
> com.example.Foo 
> 
> I get:
> 
> log4j:ERROR DOM element is - not a <log4j:configuration> element.
> log4j:WARN No appenders could be found for logger (com.example.Foo).
> log4j:WARN Please initialize the log4j system properly.
> 
> I checked my log4j.xml, and it starts with:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
> 
> <!-- $Id: log4j.xml,v 1.3 2004/03/30 03:17:52 otis Exp $ -->
(Continue reading)

ogjunk-log4j | 1 Apr 2004 09:32
Picon
Favicon

Re: ERR/WARN: DOM element, No appenders found, etc.

Hello,

I have tried that, too, without success:

$ ls -al ./log4j.xml
-rwxr-xr-x    1 otis     otis        7021 Mar 31 18:00 ./log4j.xml

$ java -Dlog4j.configuration=file:./log4j.xml com.example.Foo
log4j:ERROR DOM element is - not a <log4j:configuration> element.
log4j:WARN No appenders could be found for logger (com.example.Foo).
log4j:WARN Please initialize the log4j system properly.

I have tried file:./ and file:///, and an absolute UNIX path.  None of
those worked.

Maybe Log4J is picking up some other config file from some Jar or some
other place?  Is there a way to see which config file Log4J is
complaining about?

Thanks,
Otis

--- haggaic2v7-loguser <at> yahoo.com wrote:
> This is a simple mistake I've made many a time before.  The value of
> log4j.configuration needs to be a URL.  So the following will work:
> 
> java -Dlog4j.configuration=file:./log4j.xml
> 
> -Ian
> 
(Continue reading)

Kawthar Bt M Sulaiman | 1 Apr 2004 09:42
Picon

Re: Newbie: Log4j print to console, not to a file.


It's working now... thanks.

--Kawthar

>>> JEAN-CHARLES.JABOUILLE <at> BULL.NET 31/03/2004 03:11:07 PM >>>
Hi, you can try this. Add this line:

log4j.logger.ECPA=debug, LOGFILE

Kawthar Bt M Sulaiman wrote:

> Hello,
>
> I just started to use Log4j today and I'm still confused after
reading
> some document on apache website.
> This is what I've done, so pls let me know what else I have missed:
>
> I'm using Tomcat 4.1.30 with Windows 2000.
>
> 1.  Move the log4j.properties file to
> %CATALINA_HOME%\webapps\ROOT\WEB-INF\classes\
>      The file contains:
>      log4j.rootCategory=INFO, LOGFILE
>
>     log4j.appender.LOGFILE = org.apache.log4j.FileAppender
>     log4j.appender.LOGFILE = c:\temp\ECPA.log
>    ...
>
(Continue reading)

Jeff Longland | 1 Apr 2004 18:36
Picon

Another Newbie Question

Hi all,

log4j is currently running on a few servers here, and I'd
like to get my logs more organized.  As it stands, I'm using
FileAppenders that roll at 5mb with a backup of 20 files - a
tad messy at times.  I'm going to switch to a daily roll,
but I'd also like to try using SocketAppenders.  I have a
few questions:

- Can I use a SocketAppender to send logging data to a
syslog daemon on a remote host?

- How do I use Chainsaw with a SocketAppender?  Do I simply
setup a receiver within Chainsaw?

- When using a daily file roll, is the file overwritten
every night - or is it timestamped and a new file is
created?  Or will I have to script this myself?

Thanks,
Jeff

> -----Original Message-----
> From: Kawthar Bt M Sulaiman [mailto:mkawtha <at> maxis.com.my] 
> Sent: Thursday, April 01, 2004 2:42 AM
> To: JEAN-CHARLES.JABOUILLE <at> BULL.NET;
log4j-user <at> logging.apache.org
> Subject: Re: Newbie: Log4j print to console, not to a
file.
> 
(Continue reading)

Shapira, Yoav | 1 Apr 2004 18:41

RE: Another Newbie Question


Hi,
>- When using a daily file roll, is the file overwritten
>every night - or is it timestamped and a new file is
>created?  Or will I have to script this myself?

It's timestamped and a new one created, e.g. myLog becomes
myLog.2004-03-31 and a new file called myLog is created.

Yoav Shapira

This e-mail, including any attachments, is a confidential business communication, and may contain
information that is confidential, proprietary and/or privileged.  This e-mail is intended only for the
individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone
else.  If you are not the(an) intended recipient, please immediately delete this e-mail from your
computer system and notify the sender.  Thank you.
Jeff Drew | 1 Apr 2004 18:54

suppressing duplicates

I love log4j.  We find it invaluable and have purchased the manual to support the project.  

Does log4j have the ability to suppress duplicates?  Not the duplication caused by root loggers and
descendants.  I know that is alleviated by 
with the additivity setting.  

For example, when a connection is being reset, a loop that uses that connection will repeatedly log the
message, "connection not available".  I'd like to have that message appear only once in the log.  The loop
could be rewritten to exit and restart once the connection is available, but that creates a number of new
problems.   

Thanks

Jeffrey Drew
President and Founder
Trading Metrics, Inc.
917-453-0302
Kamlesh Patel | 1 Apr 2004 21:18

RE: Feature request for configureAndWatch

I second this request, if there is something like that :)

I want to be able to just use a URL when using configureAndWatch().
Currently this is only possible with the files on disk.

Thanks,
Kamlesh
Bruce Snyder | 1 Apr 2004 21:22
Favicon

RE: Feature request for configureAndWatch

This one time, at band camp, Kamlesh Patel said:

KP>I second this request, if there is something like that :)
KP>
KP>I want to be able to just use a URL when using configureAndWatch().
KP>Currently this is only possible with the files on disk.

This work has already been done in Geronimo. Maybe I should add it
to the Log4J configurator and contribute it to the project.

Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\ <at> 4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

The Castor Project
http://www.castor.org/

Apache Geronimo
http://incubator.apache.org/projects/geronimo.html

Gmane