way, I have to extend it from the
| AsyncAppender. How would I use this for ConsoleAppender and
| JDBCAppender?
| Any example would be great.
value="%d{ABSOLUTE} - %m%n" />
| 2. How does log4J scale, in terms of threading and volume, let's say
| currently I have 100
| AsyncAppender. How would I use this for ConsoleAppender and
| JDBCAppender?
| Any example would be great.
| 2. How does log4J scale, in terms of threading and
Hi,
I am fairly new to Log4J and I have the following questions.
By default if I use the ConsoleAppender or any other appender other
than AysncAppender, they are all synchronous. Correct?
1. To use the appender in an aysnc way, I have to extend it from the
AsyncAppender. How would I use
Hi
I wrote my own appender and have wrapped it in a AsyncAppender and got
it working. But i do the addition of this appender to the logger, and
setting of properties inside code.
Can I do this in log4j.properties ?
Thanks
--Viv
Howdy,
There's not already a PatternLayout optio
The AsyncAppender cannot be set a config file in properties
format. This is documented in the javadocs for PropertyConfigurator.
The PropertyConfigurator does not handle the advanced configuration
features supported by the DOMConfigurator such as support for Filters,
custom ErrorHandlers
Does someone know the trick for this?
How do I attach an appender to AsyncAppender in the config file (
log4j.properties )?
Thanks
-Viv
Hi
How do I attach an appender to AsyncAppender in the config file (
log4j.properties )?
In general what is the semantics or a set of all valid entries that can
go in the log4j.properties file?
Thanks
-Viv
PST), Anuj Agrawal wrote:
>Sorry for the repost. Any help on this, anyone, please?
>Anuj.
>
>--- Anuj Agrawal <[EMAIL PROTECTED]> wrote:
>> Date: Wed, 5 Feb 2003 06:19:27 -0800 (PST)
>> From: Anuj Agrawal <[EMAIL PROTECTED]>
>> Subject: AsyncAppend
Why don't you test AsyncAppender to find out the answer? Or read the code?
In short, the answer is that AsyncAppender will block when its buffer is full.
At 07:34 18.02.2003 -0800, you wrote:
Sorry for the repost. Any help on this, anyone, please?
Anuj.
--- Anuj Agrawal <[EMAIL P
Sorry for the repost. Any help on this, anyone, please?
Anuj.
--- Anuj Agrawal <[EMAIL PROTECTED]> wrote:
> Date: Wed, 5 Feb 2003 06:19:27 -0800 (PST)
> From: Anuj Agrawal <[EMAIL PROTECTED]>
> Subject: AsyncAppender assistance
> To: [EMAIL PROTECTED]
>
> Hi All
, which when reached would
spit out the logs in the buffer to a file(s). This file(s) would then
subsequently be read in by that separate thread at a later time (yes,
the order of the logs are not important for me).
Given the above scenario, it looks like i ought to be using the
AsyncAppender, but i&
Thomas/Ceki,
I am using the default buffer size (128) for the AsyncAppender and I am
not creating any appenders programmatically. I shall try the alternative
appenders and let you know how it works for us.
--Selwyn
>>> [EMAIL PROTECTED] 01/03/03 11:57AM >>>
Selwyn,
I don&
Selwyn,
I don't think the out-of-memory error is related to Log4j's AsyncAppender
(of anything in Log4j for that matter). As long as you don't explicitly
increase the buffersize, it's memory consumption should be constant.
Are you creating appenders programmatically? In case
What is your value of the BufferSize option? I suggest values under 256, in
particular the default value of 128 should work well. AsyncAppender has
been tested for memory leaks so I am somewhat surprised by the reported
OutOfMemoryException.
At 09:24 03.01.2003 -0700, you wrote:
Thanks Thomas
m with AsyncAppender is that it runs in a one-per-instance
thread
>>and it has a fixed buffer size. A more effective AsyncAppender would
share a
>>single thread (or maybe use a thread pool) between all instances. It
would
>>also use a linked list for storing log events instead of a fixed
s
| How many AsyncAppenders are you running?
Many.
| >A more effective AsyncAppender would share a
| >single thread (or maybe use a thread pool) between all
| instances. It would
| >also use a linked list for storing log events instead of a fixed size
| >buffer. This would also solve a
What do you mean you are running out of memory? Do you get an
OutOfMemoryException?
At 12:12 02.01.2003 -0700, you wrote:
I am using AsyncAppender/FileAppender to log messages for my
application. There are around 40 to 50 threads that would log messages
at a given point in time. I have my VM
At 10:39 03.01.2003 +, you wrote:
Selwyn,
Have you considered increasing the stack/heap size? Read the documentaion
for the -Xmx -Xss java JVM options.
The problem with AsyncAppender is that it runs in a one-per-instance thread
and it has a fixed buffer size.
How many AsyncAppenders are
Selwyn,
Have you considered increasing the stack/heap size? Read the documentaion
for the -Xmx -Xss java JVM options.
The problem with AsyncAppender is that it runs in a one-per-instance thread
and it has a fixed buffer size. A more effective AsyncAppender would share a
single thread (or maybe
I am using AsyncAppender/FileAppender to log messages for my
application. There are around 40 to 50 threads that would log messages
at a given point in time. I have my VM max memory size at 256m and I
very quickly run out of memory in less than 5 minutes. If I use just the
FileAppender the memory
| Is it true?
Yes. If you consult the javadoc for org.apache.log4j.AsyncAppender in log4j,
you will find the statement:
"Important note: The AsyncAppender can only be script configured using the
DOMConfigurator."
Hope this helps.
Hi All,
I've found in this newsgroup
(http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg06389.html
and
http://www.mail-archive.com/log4j-user@jakarta.apache.org/msg03327.html)
that "AsyncAppender can only be
created from config files using the XML config."
The AsyncAppender does not wait for the buffer to be full but why should
that be labeled as a problem?
At 11:44 12.09.2002 +0200, you wrote:
>Hello,
>
>I'm having problems when using an AsyncAppender, it doesn't seem to wait
>for the buffer to be full, but writes th
Hello,
I'm having problems when using an AsyncAppender, it doesn't seem to wait
for the buffer to be full, but writes the logs one by one.
My program writes one line of log each second, and I can see how they
are written to the output file one by one.
My xml configuration file seems
s.
I then wrote a test in which I added this appender to an AsyncAppender,
which I then added to a logger. When I call close() on the logger (which
calls AsyncAppender.close()), it takes 10 seconds (plus a tiny bit) for the
main thread to complete.
If I am doing things asynchronously, shouldn
Paul,
If you omit the join operation, you have no way of knowing when the
appenders attached to the AsyncAppender have finished their work. If
thinking that the previous AsyncAppender was closed, you immediately
create another AsyncAppender that encapsulates appenders writing to
the same system
You can try to reproduce the problem by not using AsyncAppender. If
you still get an out of memory error you know who to blame.
At 18:21 09.07.2002 -0400, you wrote:
>I have a large web application that has just begun failing with a gnarly
>bug.
>The AsyncAppender dispatcher thread di
I have a large web application that has just begun failing with a gnarly
bug.
The AsyncAppender dispatcher thread dies, which causes the thread
that is writing to the async appnder to block, and then other threads
to wait on the async appender's mutex heald by that blocked thread,
which s
WriterAppender and AsyncAppender both extends AppenderSkeleton, but are
otherwise unrelated. AsyncAppender can't be configured via
PropertyConfigurator. Your thread problem must stem from something else,
because no AsyncAppender will be created in your app unless you configure
its us
hi all,
I have a problem in using AsyncAppender. Whenever I uses
RollingFileAppender which extends from FileAppender while inturn extends
from WriteAppender which extends from AsyncAppender, a large number of
threads are created and finally I got out of Memory Exception. My
properties file is
The AsyncAppender documentation reads
"(..) The AsyncAppender uses a separate thread to serve the events in
its bounded buffer (...)"
Reading the code confirms this statement (surprisingly enough). A thread is
started upon creation, and the thread is notified each time a log ev
Hi everyone,
I would like to know more about how Log4J is architectured. More in
particular the use of the AsyncAppender within a J2EE environment. Suppose
I'v got 3 EJB's: EJB1, EJB2 and EJB3 that create loggers with names:
TraceLogger.EJB1, TraceLogger.EJB2 and TraceLogger.EJB
Hello Jean-François,
Two possible explanations for the "log4j:ERROR Attempted to append ..." mesage:
1) You have myAsyncAppender attached to multiple loggers.
2) Are you sure myAsyncAppender is really attached to root
and not somewhere else?
BTW, how come your AsyncAppender is
Hi all,
I have an AsyncAppender appended to the root category.
I have a shutdown thread (registered using Runtime.addShutdownHook) that
must be run when my program exits. In this thread, I log some traces.
As I am in a shutdown process, I don't want the AsyncAppender to be
operational i
Hi everyone,
I am using AsyncAppender inside Iplanet application server on Solaris. The JDK
verions is 1.2. Does anyone know how we can make sure all the messages inside
the buffer of AsyncAppender are logged before the application server shutdown?
With a standalone application, I can call the
about using the AsyncAppender in a different Thread but
it really doesn't help.
Finally we are using a JMS Server with the JMSAppender and
everything works fine.
Bye,
Marc
Original Message
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED],
Asunto: RE: problems using SocketAppend
our server would block, practicaly bringing everything to a stand
still. Thinking alone the same lines as you did, I started to use
AsyncAppender, but the problem did not go away. So, I started testing the
client for problems, such as the fileAppender and the TextPaneAppender. What
I discovered was
Any help on that?
Thanks,
Marc
Original Message
De: [EMAIL PROTECTED]
Para: [EMAIL PROTECTED],
Asunto: RE: problems using SocketAppender and AsyncAppender
Fecha: Tue, 15 Jan 2002 11:23:57 +0100
> Hello, we are using log4j in our application (configuring some
>
for
I/O and then the socket blocks too, and due to, the main thread too.
Finally we decided to use the AsyncAppender, it should work
asynchronous, it would use another thread to write so the main thread
will never become blocked. But, if one of the SocketAppenders
referenced in the AsyncAppender
--
>| From: Ceki Gulcu [mailto:[EMAIL PROTECTED]]
>| Sent: 16 December 2001 11:31
>| To: Log4J Users List
>| Subject: RE: ArrayIndexOutOfBoundsException in AsyncAppender
>|
>|
>|
>| Thomas,
>|
>| This is a very interesting comment. I disagree with it for the
>| following r
omas
| -Original Message-
| From: Ceki Gulcu [mailto:[EMAIL PROTECTED]]
| Sent: 16 December 2001 11:31
| To: Log4J Users List
| Subject: RE: ArrayIndexOutOfBoundsException in AsyncAppender
|
|
|
| Thomas,
|
| This is a very interesting comment. I disagree with it for the
| following reason. W
to:[EMAIL PROTECTED]]
>| Sent: 14 December 2001 22:11
>| To: Log4J Users List
>| Subject: Re: ArrayIndexOutOfBoundsException in AsyncAppender
>|
>|
>|
>| Thomas,
>|
>| Looks like a bug to me. Thanks for the info. The likely cause of
>| this problem is that the
| Subject: Re: ArrayIndexOutOfBoundsException in AsyncAppender
|
|
|
| Thomas,
|
| Looks like a bug to me. Thanks for the info. The likely cause of
| this problem is that the 'vw' static variable of type
| VectorWriter is not accessed in a synchronized manner. You have
| two threads trying to lo
Thomas,
Looks like a bug to me. Thanks for the info. The likely cause of this problem is that
the 'vw' static variable of type VectorWriter is not accessed in a synchronized
manner. You have two threads trying to log an event containing an exception near
simultaneously.
One easy solution is
Hi,
This error inside the log4j API caused our server to hang (this trace was
logged in system.err.)
2001-12-14 10:07:28,735 - "java.lang.ArrayIndexOutOfBoundsException: 0 >= 0"
2001-12-14 10:07:28,735 - " at java.util.Vector.elementAt(Vector.java:417)"
2001-12-14 10:07:28,745 - " at
org
In your TracerLogger getCategory() method, you have:
cat.addAppender( new AsyncAppender());
That (obviously) creates a new appender for -every- class. Try configuring once and
putting the appender on the root category. Obviously you don't need a different
appender for
Hi All,
I had poste dthis question earlier as well. I am havinn problem with the
AsyncAppender. We are trying to implement the log4j in our J2EE application.
When we start the application and monitor we see 80 threads created whereas
the Weblogic server 6.0sp1 which we are usinf spawns max 30
ation thread(s)
blocks.
--
Thomas
| -Original Message-
| From: Andrew B [mailto:[EMAIL PROTECTED]]
| Sent: 16 October 2001 17:22
| To: [EMAIL PROTECTED]
| Subject: AsyncAppender questions
|
|
| Hi,
|
| The documentation for AsyncAppender doesn't really
| help me figure out what it is
Hi,
The documentation for AsyncAppender doesn't really
help me figure out what it is useful for. Is it just
for sending stuff to multiple appenders?
Thanks
Andrew
=
The geek shall inherit the earth.
__
Do You Yahoo!?
Make a
Hello all,
The API docs suggests that "The AsyncAppender can only be script
configured using the DOMConfigurator. "
Any reasons ??? or any plans to support other like Propertiles file
.
Thanks
Naresh
cc:
08/16/2001 Subject: Re: MDC and AsyncAppender
Are you using the latest code from our CVS repository? Ceki
At 11:04 16.08.2001 -0400, [EMAIL PROTECTED] wrote:
>Hi,
>
> How can I use the MDC context with the AsyncAppender? The code below
>always makes the MDC come out empty, which I understand why.
>I need to use the Async
Hi,
How can I use the MDC context with the AsyncAppender? The code below
always makes the MDC come out empty, which I understand why.
I need to use the AsyncAppenders and I also want to use the MDC and the %X
since I don't want to make a code change everytime I add a new variable t
Title: AsyncAppender vs. JMSAppender
Hi,
I would like to asynchronously log messages (for performance reasons). I know the AsyncAppender is designed for this purpose, but I believe there have been performance measures that don't necessary prove the case. I was also thinking that I
As long as I'm posting questions
I've got a server process, which services applets via RMI. The server (not
the applets) uses Log4J. If I use an AsyncAppender, does anybody have any
suggestions for where/how I could invoke Category.shutdown? I'm used to
doing that when
Yes. Like Category, AsyncAppender implements AppenderAttachable. The
syntax is the same. DOMConfigurator example
e know.
> Currently in my config file I am using the RollingFileAppender with my
> Category objects, can I specify from the config file that Category object
> use the AsyncAppender which in turn uses the RollingFileAppender?
>
> Bill
>
> -
Hello,
I am relatively new to log4j, so if I'm way off base with this question,
feel free to let me know.
Currently in my config file I am using the RollingFileAppender with my
Category objects, can I specify from the config file that Category object
use the AsyncAppender which in turn use
Hi Michiel,
The benefit of the AsyncAppender is not that logging
runs faster (ie log messages get written to disk faster),
but that code which *calls* log methods runs faster,
because it does not wait for the logged message to
be written.
In order to prove this, what you need is a very slow
Michiel,
The usefulness or lack thereof of AsyncAppender is not dependent on the OS. The new
JVMs do file buffering on all platforms. Don't confuse buffering of the file write
operation with what AsyncAppender does.
File buffering let you write large chunks to disk instead of writing
delay. That's the idea of
AsyncAppender, isn't it? But the thing is, it also gets faster per
logging if I don't use AsyncAppender. With about the same rate. At
least, that's my provisional result.
My explanation would be linux file buffering, which makes writing to
files faster
Michiel,
What kind of testing are you doing? What do you mean by logging gets faster? With
respect to what? Cheers, Ceki
At 10:59 12.02.2001 +0100, you wrote:
>I did a little research if using the AsyncAppender would make
>sense. So, I made a little program with delays in it etc,
I did a little research if using the AsyncAppender would make
sense. So, I made a little program with delays in it etc, as is
suggested in the Logging javadoc of log4j. I do find no improvements
tough in the performance, when using AsyncAppender. The thing is,
that even without AsyncAppender
63 matches
Mail list logo