Re: DatePattern question

2008-09-17 Thread Reza Razavipour
I understand this, thanks. The question was how to do that at runtime,
on the fly...

On Tue, Sep 16, 2008 at 11:02 PM, NehaG [EMAIL PROTECTED] wrote:

 The DatePattern Attribute can be set from the configuration file of log4j as
 follows:

 log4j.appender.appendername.DatePattern='.'dd-MMM-'.log'



 Reza Razavipour-2 wrote:

 All,

 how do I set and get DatePattern attribute from a
 DailyRollingFileAppender, in code?

 Thanks
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context: 
 http://www.nabble.com/DatePattern-question-tp19512835p19525870.html
 Sent from the Log4j - Users mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DatePattern question

2008-09-17 Thread Reza Razavipour
Thanks for the hint, my version of log4j does not have such support, I
did RTFM :)

Which version of log4j has these methods? I will check again though.

Thanks
Reza

On Wed, Sep 17, 2008 at 12:35 AM, Michael Erskine
[EMAIL PROTECTED] wrote:
 how do I set and get DatePattern attribute from a
 DailyRollingFileAppender, in code?

 Hi Reza,

 I don't want to sound all RTFM :) but the DailyRollingFileAppender has 
 methods getDatePattern and setDatePattern! Perhaps a glance at the code? :)

 Regards,
 Michael Erskine.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DatePattern question

2008-09-16 Thread Reza Razavipour
All,

how do I set and get DatePattern attribute from a
DailyRollingFileAppender, in code?

Thanks
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



log4j files and parsing and presentation

2008-09-16 Thread Reza Razavipour
All,

I am tasked with writing a log4j file aggregator/viewer. Search
criteria such as date ranges and etc...

Any support for log4j file parsing? Combining a set of log files?

Any pointers are appreciated.

Thanks
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: log4j files and parsing and presentation

2008-09-16 Thread Reza Razavipour
Yes, this is a great tool. What I need to do is to do this
programatically. So, the application, at any point in time, will have
targets that have log4j log files. At user's request, which would be a
get of all files, with some date/time constraints, the application
will have to combine the log files, filter on date/time and present
the log entries in some tbd format...

What I was wondering is that:
1. Does log4j has anything to support such  things as concatenation of
log files, searching and filtering of log files?
2. If not, is there any other package that does similar things.

It sounds like the ChainSaw approach is not a programmatic way to do
this. Correct me if I am wrong.

Thanks
Reza

On Tue, Sep 16, 2008 at 4:11 PM, Scott Deboy [EMAIL PROTECTED] wrote:
 You can use Chainsaw V2 along with a LogFilePatternReceiver to view and
 aggregate log files.

 You can filter/search and colorize using the built-in expression syntax,
 which does support date ranges, but it's a bit verbose.  Example:

 TIMESTAMP = '2008/09/08 09:41:23'  TIMESTAMP = '2008/09/08 09:41:24'

 To aggregate log files, I'd load all of the log files into Chainsaw and
 then use the 'View-Create custom expression LogPanel' menu item, and
 then specify an expression defining the events you want to see in the
 new view (a new tab will be created containing those aggregated events).

 You can find Chainsaw V2 here:

 http://logging.apache.org/chainsaw/



 Scott Deboy
 Principal Engineer
 COMOTIV SYSTEMS
 111 SW Columbia Street Ste. 950
 Portland, OR  97201
 Office: 503.224.7496
 Direct Line: 503.821.6482
 Cell: 503.997.1367
 Fax: 503.222.0185
 [EMAIL PROTECTED]
 www.comotivsystems.com

 -Original Message-
 From: Reza Razavipour [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, September 16, 2008 3:38 PM
 To: Log4J Users List
 Subject: log4j files and parsing and presentation

 All,

 I am tasked with writing a log4j file aggregator/viewer. Search
 criteria such as date ranges and etc...

 Any support for log4j file parsing? Combining a set of log files?

 Any pointers are appreciated.

 Thanks
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [SPAM (Bayesain Analysis)] - Logger object and change filename - Bayesian Filter detected spam

2008-09-09 Thread Reza Razavipour
Ok, let me explain more...

I have a set of elements, a queue of them...I have a thread pool of
processors. A processor takes an element from the queue and logs some
information about them. So what I need to do is to log the information
about element XYZ to a file called XYZ.log and for element ABC to the
file ABC.log and on and on...

From the log4j.xml for the app, there is an appender called
AllElements, lets say. In addition to all element specific log files,
I need to log to this file also...Now what I need to do is to clone.
If it is a rollingFileAppender the element specific log appender needs
to be the same, the pattern format should be the same, the only
difference is appender file name...

So for each element, I need a brand new logger with appenders exactly
the same as the one defined in log4j.xml file, the only difference is
the filename for the appender, there is only one.

Does this help at all clarify what I need to do?

Thanks
Reza




On Tue, Sep 9, 2008 at 8:00 AM, Bender Heri [EMAIL PROTECTED] wrote:
 Loggers do not have file names attached. Probably you mean a
 FileAppender.

 Each configured Appender is instantiated as singleton, even if it is
 attached to more than one Logger.

 Loggers are identified by a arbitrary String, commonly the FQCN.
 Therefore you cant clone a Logger which has the same name as the
 original.

 Explain more about your needs. Why do you have to clone it?

 Heri

 -Original Message-
 From: Reza Razavipour [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 08, 2008 5:38 PM
 To: Log4J Users List
 Subject: [SPAM (Bayesain Analysis)] - Logger object and
 change filename - Bayesian Filter detected spam

 All,

 I have a Logger object and I need to create a clone of it
 and change its filename to a different name. How does one do that?
 The idea here is that I have initialized a Logger instance
 from log-4j.xml file. Now I need to create a new one, off of
 it or clone and change the filename. Every attribute of the
 new Logger instance should be whatever is in the file, only
 filename is diifferent.

 Thanks in advance.
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [SPAM (Bayesain Analysis)] - Logger object and change filename - Bayesian Filter detected spam

2008-09-09 Thread Reza Razavipour
I have, I just don't see how that works for my case???

Reza

On Tue, Sep 9, 2008 at 9:28 AM, Jacob Kjome [EMAIL PROTECTED] wrote:
 Search the list for MultiFileAppender or something to the effect of
 per-thread logging based on MDC values.

 Jake


 On Tue, 9 Sep 2008 09:00:53 -0700
  Reza Razavipour [EMAIL PROTECTED] wrote:

 Ok, let me explain more...

 I have a set of elements, a queue of them...I have a thread pool of
 processors. A processor takes an element from the queue and logs some
 information about them. So what I need to do is to log the information
 about element XYZ to a file called XYZ.log and for element ABC to the
 file ABC.log and on and on...

 From the log4j.xml for the app, there is an appender called
 AllElements, lets say. In addition to all element specific log files,
 I need to log to this file also...Now what I need to do is to clone.
 If it is a rollingFileAppender the element specific log appender needs
 to be the same, the pattern format should be the same, the only
 difference is appender file name...

 So for each element, I need a brand new logger with appenders exactly
 the same as the one defined in log4j.xml file, the only difference is
 the filename for the appender, there is only one.

 Does this help at all clarify what I need to do?

 Thanks
 Reza




 On Tue, Sep 9, 2008 at 8:00 AM, Bender Heri [EMAIL PROTECTED] wrote:

 Loggers do not have file names attached. Probably you mean a
 FileAppender.

 Each configured Appender is instantiated as singleton, even if it is
 attached to more than one Logger.

 Loggers are identified by a arbitrary String, commonly the FQCN.
 Therefore you cant clone a Logger which has the same name as the
 original.

 Explain more about your needs. Why do you have to clone it?

 Heri

 -Original Message-
 From: Reza Razavipour [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 08, 2008 5:38 PM
 To: Log4J Users List
 Subject: [SPAM (Bayesain Analysis)] - Logger object and
 change filename - Bayesian Filter detected spam

 All,

 I have a Logger object and I need to create a clone of it
 and change its filename to a different name. How does one do that?
 The idea here is that I have initialized a Logger instance
 from log-4j.xml file. Now I need to create a new one, off of
 it or clone and change the filename. Every attribute of the
 new Logger instance should be whatever is in the file, only
 filename is diifferent.

 Thanks in advance.
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Logger object and change filename

2008-09-08 Thread Reza Razavipour
All,

I have a Logger object and I need to create a clone of it and change
its filename to a different name. How does one do that?
The idea here is that I have initialized a Logger instance from
log-4j.xml file. Now I need to create a new one, off of it or clone
and change the filename. Every attribute of the new Logger instance
should be whatever is in the file, only filename is diifferent.

Thanks in advance.
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get values from log4j.xml file

2008-08-26 Thread Reza Razavipour
Thanks for the response. When I try it, I get null for Appender. Any
thoughts on why? The code is as follows:

jboss-log4j.xml has

appender name=XXX_LOG_FILE
class=org.jboss.logging.appender.DailyRollingFileAppender
param name=File value=${jboss.home.dir}/bin/log//
param name=Append value=true/
param name=DatePattern value='.'-MM-dd'.log'/
layout class=org.apache.log4j.PatternLayout
param name=ConversionPattern value=%d %m%n/
/layout
/appender

at runtime I have
import org.apache.log4j.Appender;
import org.apache.log4j.Logger;

private static Logger log = Logger.getLogger(MyClass.class);

in the constructor, I have
Appender serverAppender = log.getAppender(XXX_LOG_FILE);
if (serverAppender != null)
{
String name = serverAppender.getName();
}

serverAppender is always null.

Any thoughts on this?
Thanks
Reza






On Tue, Aug 26, 2008 at 12:25 AM, Bender Heri [EMAIL PROTECTED] wrote:
 Logger.getLogger().getAppender( SERVER_LOG );

 -Original Message-
 From: Reza Razavipour [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 26, 2008 2:30 AM
 To: Log4J Users List
 Subject: How to get values from log4j.xml file

 All,

 I have a log4j.xml file for my application. I have something
 like the following in the file:
   appender name=SERVER_LOG
 class=org.jboss.logging.appender.DailyRollingFileAppender
   errorHandler
 class=org.jboss.logging.util.OnlyOnceErrorHandler/
   param name=File
 value=${jboss.server.home.dir}/log/server.log/
 

/appender

 How can I programmatically get the properties for SERVER_LOG appender?

 Thanks in advance.
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to get values from log4j.xml file

2008-08-25 Thread Reza Razavipour
All,

I have a log4j.xml file for my application. I have something like the
following in the file:
appender name=SERVER_LOG
class=org.jboss.logging.appender.DailyRollingFileAppender
errorHandler 
class=org.jboss.logging.util.OnlyOnceErrorHandler/
param name=File 
value=${jboss.server.home.dir}/log/server.log/


   /appender

How can I programmatically get the properties for SERVER_LOG appender?

Thanks in advance.
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



which config file

2008-08-25 Thread Reza Razavipour
All,

how can I programmatically determine the URL to the xml file that my
app has configured itself based on? What I am trying to do is to get
the URL, load it into a DOMConfigurator so I can determine the
specifics of an appender.

Is there a better way?

Thanks
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



each thread needs a log4j file

2008-08-22 Thread Reza Razavipour
All,

I have a thread pool and a set of managed objects. I need to have one
log4j file for each of the managed objects. I need to do this
dynamically since the number of managed objects will vary during the
life of the application.

Any thoughts on this?

Thanks
Reza

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: each thread needs a log4j file

2008-08-22 Thread Reza Razavipour
Due to the amount of logged entries for each managed object.

On Fri, Aug 22, 2008 at 6:45 AM, Douglas E Wegscheid
[EMAIL PROTECTED] wrote:
 *why* do you need a separate file for each managed object?

 Douglas E Wegscheid
 Lead Technical Analyst, Whirlpool Corporation
 (269)-923-5278

 A wrong note played hesitatingly is a wrong note. A wrong note played
 with conviction is interpretation.





 Reza Razavipour [EMAIL PROTECTED]
 08/22/2008 09:39 AM
 Please respond to
 Log4J Users List log4j-user@logging.apache.org


 To
 log4j-user@logging.apache.org
 cc

 Subject
 each thread needs a log4j file






 All,

 I have a thread pool and a set of managed objects. I need to have one
 log4j file for each of the managed objects. I need to do this
 dynamically since the number of managed objects will vary during the
 life of the application.

 Any thoughts on this?

 Thanks
 Reza

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]