Fallback Error Handler

2003-12-17 Thread Milind Rao
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.

Re: How to detect duplicate messages in log4j

2003-12-17 Thread Milind Rao
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

RE: No of Logger instances

2003-09-19 Thread Milind Rao
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

RE: Bug in JDBCAppender

2003-09-08 Thread Milind Rao
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

Bug in JDBCAppender

2003-09-05 Thread Milind Rao
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.

Filtering based on Appender

2003-09-03 Thread Milind Rao
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

RE: Filtering based on Appender

2003-09-03 Thread Milind Rao
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

Re: Problems with JDBCAppender

2003-08-14 Thread Milind Rao
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

Re: Comments and Questions section of your book

2003-08-14 Thread Milind Rao
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

Re: Comments and Questions section of your book

2003-08-14 Thread Milind Rao
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

Problems with JDBCAppender

2003-08-06 Thread Milind Rao
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

Customising Chainsaw

2003-07-30 Thread Milind Rao
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

RE: Customising Chainsaw

2003-07-30 Thread Milind Rao
. 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

RE: Customising Chainsaw

2003-07-30 Thread Milind Rao
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

RE: log4j ObjectRenderer

2003-07-24 Thread Milind Rao
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

RE: Reading events

2003-07-18 Thread Milind Rao
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

Rendering an object based on the appender

2003-07-18 Thread Milind Rao
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

File locking in FileAppender

2003-07-14 Thread Milind Rao
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

RE: File locking in FileAppender

2003-07-14 Thread Milind Rao
. 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

Re: Accessing multiple log files

2003-06-30 Thread Milind Rao
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

Accessing multiple log files

2003-06-25 Thread Milind Rao
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

Accessing multiple log files

2003-06-24 Thread Milind Rao
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