Re: [SCL-4] Intercepting LoggingEvent

2010-11-26 Thread Mohan.Radhakrishnan
@Heri Do you think this could affect performance ? @Scott It looks like this is not part of 1.2.16 or extras. Git has the code though. -- View this message in context: http://old.nabble.com/Intercepting-LoggingEvent-tp30302884p30308920.html Sent from the Log4j - Users mailing list archive at

Intercepting LoggingEvent

2010-11-24 Thread Mohan.Radhakrishnan
I am trying to intercept the LoggingEvent which is an instance of a custom LoggingEvent created by a library. I have a custom appender and also a filter but neither seems to be a clean way of extracting specific custom information for logging. I think there should be a way to log only what I want

Re: Extending Logger

2010-11-12 Thread Mohan.Radhakrishnan
I think I have done what was suggested but there is a catch. I decided to go for a parallel log4j repository for more manageability but retained the log4j Logger. I didn't extend it or wrap it. ( e.g ) JBoss uses its own repository to take care of multiple web applications. The problem is that s

RE: Extending Logger

2010-11-02 Thread Mohan.Radhakrishnan
Yes. I am responding to your suggestion. The setup performance is not very important. The runtime performance though is. If I setup everything programmatically log4j.xml is not at all needed ? -- View this message in context: http://old.nabble.com/Extending-Logger-tp30018462p30113852.html Sent

RE: Extending Logger

2010-11-02 Thread Mohan.Radhakrishnan
So this is what I understand. If I have too many appender sections in the XML then one appender for a logger is created by log4j. Instead of that I can have one appender and a custom logger for each log file. Both could be equivalent as far as performance is concerned. Am I right ? -- View th

RE: Extending Logger

2010-11-02 Thread Mohan.Radhakrishnan
I wanted to associate the logger file with each Logger instead of the Appender. I have a setFile/getFile in the Logger that I plan to call using my custom Appender so that the log message is written to the file associated with the Logger. Reasons : 1. We have two many appender sections in the XM

Re: Extending Logger

2010-11-01 Thread Mohan.Radhakrishnan
I don't have a way to put my custom logger in the log4j repository so that it is used in place of the log4j Logger. -- View this message in context: http://old.nabble.com/Extending-Logger-tp30018462p3044.html Sent from the Log4j - Users mailing list archive at Nabble.com. -

Re: Extending Logger

2010-10-29 Thread Mohan.Radhakrishnan
I have wrapped log4j's Logger in a 'custom' logger. The custom logger is my logger. The FQCN of my logger is set in the 'logger' element in the XML. I have an extra parameter to set in my logger that is not in Log4j's logger. So I think that I have to configure this when log4j calls void selec

Re: Extending Logger

2010-10-29 Thread Mohan.Radhakrishnan
Since extension of Logger is discouraged I wrap it. I think the configuration can be set like this. Thanks, Mohan -- View this message in context: http://old.nabble.com/Extending-Logger-tp30018462p30085722.html Sent from the Log4j - Users mailing list archive at Nabble.com. -

Re: Extending Logger

2010-10-29 Thread Mohan.Radhakrishnan
Solved this. Is there a way to get my custom logger that log4J has configured and set some values using reflection ? The API does not seem to return the correct type. It returns Logger always and not CustomLogger. -- View this message in context: http://old.nabble.com/Extending-Logger-tp300184

Extending Logger

2010-10-21 Thread Mohan.Radhakrishnan
The complete Log4J manual discourages us from extending Logger but we use the recommended pattern then 'repository' and 'getEffectiveLevel()' are inaccessible because they are protected in Category. public void trace(Object message) { if (repository.isDisabled(Level.TRACE_INT)) {

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-18 Thread Mohan.Radhakrishnan
Jacob, What you are suggesting can be done using the XML itself ? I think this new appender is required due to the limitation in associating an individual logger with its own file. Thanks, Mohan -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-name

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-15 Thread Mohan.Radhakrishnan
My initial idea is to pass multiple file names in the XML in the appender section and maintain a list in the custome appender Java code and then based on the logger name or some other parameter pick the correct file name. Performance is one of our major concerns. -- View this message in context:

Re: Loggers share an Appender instance?

2010-10-15 Thread Mohan.Radhakrishnan
Hi Shef, Looks like your question is like mine ( http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-td28024737.html ). My appender is only one by I want a logger specific file. The recommendation is a custom appender. Thanks, Mohan -- View thi

Re: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Mohan.Radhakrishnan
Ok. Will try. I think you mean that in order to associate a file name with each logger in the hierarchy instead of the appender I need to write a custom appender. Am I on the right track then ? -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-a

RE: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-10-14 Thread Mohan.Radhakrishnan
Hope to revive this thread. Is there any way to use the feature I have described. 1. Use the logger hierarchy like Heri had suggested. 2. Use a separate logger file for each logger in the hierarchy. Thanks, Mohan -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-mult

Log as a template for a report

2010-07-06 Thread Mohan.Radhakrishnan
Hi, We are writing several logs as text files. This is used by the ops. teams but we also want the capability to convert the logs files to reports. These reports could be HTML or PDF and the FreeMarker templating engine can achieve this. So there could be two types of log formats for eac

Regex as filter param value

2010-04-16 Thread Mohan.Radhakrishnan
I need a filter that uses regex in log4j.xml. The XML validation complains. CDATA is understood by log4j ? param name="Expression" value="^[]+)>(.+?)" -- View this message in context: http://old.nabble.com/Regex-as-filter-param-value-tp28267219p28267219.html Sent from

RE: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-04-14 Thread Mohan.Radhakrishnan
This does not seem to be possible unless I use code ? I understand the logger hierarchy. -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p28251807.html Sent from the Log4j - Users mailing list archive at Nabble.co

RE: RollingFileAppender not working consistently

2010-04-13 Thread Mohan.Radhakrishnan
1. I had to copy the newer DTD from the Apache extras JAR to the log4j JAR. 'rollingPolicy' was not recognized by the older DTD. Is this right ? 2. Put both JARS in the classpath. This warning is shown though. log4j:WARN Continuable parsing error 182 and column 23 log4j:WARN The content of elem

RE: RollingFileAppender not working consistently

2010-04-12 Thread Mohan.Radhakrishnan
This seems to be working now. There is no need for renaming a file unless I am missing something ! I get one timestamped file for a day. Now the next step could to combine with a SizeBasedTriggeringPolicy Mohan.Radhakrishnan wrote: > > TimeBasedRollingPolicy seems to be the so

RE: RollingFileAppender not working consistently

2010-04-12 Thread Mohan.Radhakrishnan
TimeBasedRollingPolicy seems to be the solution. Correct me if I am wrong. Extract from the doc. During November 23rd, 2004, logging output will go to * the file /wombat/foo.2004-11-23. At midnight and for * the rest of the 24th, logging output will be directed to * /wombat/

RE: RollingFileAppender not working consistently

2010-04-08 Thread Mohan.Radhakrishnan
I have looked at the source here and I have a question. Since the log4j extras has other methods of rolling over that are time based I thought if we schedule the rename for a lean period when there is not much log file updates then there would be no problem. Am I on the right track ? What about

RE: [SCL-2] Re: Multiple log files, multiple logger names and the same appender

2010-04-08 Thread Mohan.Radhakrishnan
Thanks. The log files are also different for each logger but the log file configuration is inside the appender configuration ! -- View this message in context: http://old.nabble.com/Multiple-log-files%2C-multiple-logger-names-and-the-same-appender-tp28024737p28179638.html Sent from the Log

Re: Multiple log files, multiple logger names and the same appender

2010-04-08 Thread Mohan.Radhakrishnan
Hopefully more explanation can attract some ideas here. I am using XML configuration and a custom appender. So I have one section in the XML corresponding to one logger name and one log file. So for each different logger name, log file and the same custom appender I need to add one more section

RE: RollingFileAppender not working consistently

2010-04-05 Thread Mohan.Radhakrishnan
Don't mean to hijack this thread. We have a pressing need to move to DailyRollingFileAppender due to the same problems mentioned in this thread. Since midnight is not suitable due to heavy logging we want to use DailyRollingFileAppender at midday or some other time. Is that possible ? I refer h

RE: RollingFileAppender not working consistently

2010-04-05 Thread Mohan.Radhakrishnan
We see the same problem. Sometimes several successive attempts to rename fail. Actually we also have multithreaded application and we think that one of the threads could be writing when the file is being renamed. We are thinking of using the DailyRollingAppender. Is that an alternative ? -- Vie

Multiple log files, multiple logger names and the same appender

2010-03-25 Thread Mohan.Radhakrishnan
Hi, I have been able to channelize the log information by writing a custom appender and specifying the logger name as 'Test1' into a separate log file. How can I use multiple log files, multiple logger names and the same appender ? In short I would like to avoid repeating