I need to access the backup appender in the fallback error handler of a primary
appender, but there is no method to
access it and the appender is package private. I have subclassed the
FallbackErrorHandler class to redefine the
setBackupAppender method and added a getBackupAppender method.
The problem is how to determine if a message is a duplicate?
Is there any API that lets me read all the events that have occurred in last
30 seconds, whereby I can do the comparison and leave out stack trace of
duplicate messages.
One way would be to create your own Log class which has a unique
What does make a big difference, since you seem to care about this, is
using if(logger.isDebugEnabled()) { ... } around logger.debug
statements.
You might want to take a look at Just4log (http://just4log.sourceforge.net/) which
acts like a C Pre-processor and does this
using an ANT task.
I
JDBCAppender is a SIMPLE implementation
(read reference implementation) that is designed to be subclassed to provide
better functionality (e.g. using connection pooled DataSources in a webapp).
-Original Message-
From: Milind Rao [mailto:[EMAIL PROTECTED]
Sent: Friday, September 05, 2003 14:09
There is a bug in JDBCAppender's execute method. If there is a SQLException, the
connection is not
closed. The best place to close a connection/statement is in finally. What's
happening now, is
I'm getting a connection leak every time an SQL exception happens.
BTW, the log also gets lost.
Is it possible to do filtering based on appenders rather than on logger name? I don't
think setting
additivity to false is what I want.
What I want to do is show DEBUG messages of all loggers on the console, but have only
ERROR messages
go to the NT Event logger.
I tried the following
On Wed, 3 Sep 2003 12:40:20 -0500, Ebersole, Steven wrote:
log4j.appender.A2.threshold=ERROR
Worked like a charm. Thanks.
Regards
Milind
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
No one has these problems using the JDBCAppender?
On Wed, 06 Aug 2003 15:42:47 +0550, Milind Rao wrote:
I created a subclass of JDBCAppender for logging to the database and am
running into the following problems. I'd
apreciate if someone who's been using this can shed some light on them.
1
On a related topic, I was going to buy the book, but was wondering if a newer edition
will be released shortly with
changes in log4j 1.3. One thing I hate is reading a technical book and then having to
read it all over again, because
some stuff changed in how I should go about. Can't be helped
Thus, I am facing a similar question albeit of different scale. Do we
reprint or wait until the next edition is ready? It seems more reasonable
to reprint the book instead of waiting for the next edition to be ready in
7+ months.
If it's 7 months away, then definitely reprint. At least my
I created a subclass of JDBCAppender for logging to the database and am running into
the following problems. I'd
apreciate if someone who's been using this can shed some light on them.
1. Unless the Buffer Size is 1 (or less than the number of logs being written), the
logs don't make it to
My log message is a complex XML element since there was other information, such as
hardware, message ID,
replacement parameters etc. that I needed in the message.
A log file consists of multiple Log message elements. A Log message would be
something like
Log
LevelInfo/Level
.
Chainsaw could then be used to view the events. One thing to remember
is that Chainsaw renders properties as a single entry - a
comma-delimited set of name/value pairs (a single field).
-Original Message-
From: Milind Rao [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 12:42 AM
tabs.
-Original Message-
From: Milind Rao [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 7:45 AM
To: Log4J Users List
Subject: RE: Customising Chainsaw
Okay, then I guess I'll have to roll my own since I'd like to see
different columns for different elements in the message so
The log4j configuration doesn't let you associate a renderer with a
layout. You write the renderer and render the object however you want.
The layout is associated with an appender.
I'd like to add this to a wish list if there is one. I'd have liked to use different
rendering of objects for
Absolutely right. Never use serialisation for persistence. If the code changes and
the reader/writer are not in sync, then
there will be failure while reading the data. Worse, since it's binary, there isn't a
whole lot you can do other than back off
to the version of code prior to the
Is it possible to render an object differently for different appenders? When I render
to a file, I use XML. This is very
difficult to read on the console. On the console, I'd like to use only a small subset
of the elements without the tags.
In the properties file, what I can do now is
Is FileAppender thread safe? I don't see any file locking occuring in the
FileAppender WriterAppender classes.
If I have 2 processes writing to the same log file, could I get a conflict?
If I have 2 threads writing to the same log file, could I get a conflict?
I haven't been able to get a
. The FileOutputStream are
implemented using native methods and uses OS specific file locks to enforce
concorrency control.
Hope this helps.
--
Thomas
| -Original Message-
| From: Milind Rao [mailto:[EMAIL PROTECTED]
| Sent: 14 July 2003 12:18
| To: Log4J Users List
| Subject: File locking in FileAppender
Yes you are right but ...
using a timer would force the usage of 2 different approaches / pieces
of code :
1ø. For normal code
2ø. For EJB / Application Server
Can you elaborate? I don't see why a Timer would be a problem for EJBs. In fact
writing to a file itself is not recommened
Any help from some one with more experience with log4j would be appreciated.
One other thing I noticed with the DailyRollingFileAppender is that no timer is being
used. So when the rollover time
occurs, a new file is not created. A new file is created only on the first log event
after the
I'm looking at using log4j to do logging in our application. Multiple clients on
different machines will be logging events.
The Message object in the LoggingEvent class is an instance of a proprietary Log
class that contains a date. The Log
class implements ObjectRenderer and contains a
22 matches
Mail list logo