Re: SocketAppender based filtering relay/router..

2001-07-30 Thread Sam Newman
> >> Well, chainsaw already acts as a prety good socket listener. > I know chainsaw, but we need more. Well, chainsaw is open source - what about using it as a starting point and expanding it to include what you want? > >> But if I understand you correctly, you want the socket listener > >> its

Re: multiple hierarchy trees

2001-07-30 Thread Sam Newman
They are used a little in one of the contrib programs - I think the socket listener example. Also the NumberCruncher stuff uses them a bit (included on the log4j source). But I agree, a better documented example would be nice sam - Original Message - From: "Robert Hayes" <[EMAIL PROTECTED

Re: SocketAppender based filtering relay/router..

2001-07-30 Thread Sam Newman
Well, chainsaw already acts as a prety good socket listener. But if I understand you correctly, you want the socket listener itself to then re-log messages to various sources? Why not just have this done in the first place, rather than going thorugh the overhead of relogging the same messages? Any

Re: Priority on Appenders

2001-07-30 Thread Sam Newman
yes - if the appender you're using implements AppenderSkeleton (most/all ofthe provided Appenders do). In this case you call the setThreshold() method. For more details check AppenderSkeleton docs here: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/AppenderSkeleton.h tml hope this hel

disabling categories (was: channels in Log4j)

2001-07-30 Thread Sam Newman
Gotcha. Sorry if I was appering thick :-). From looking at the code, I couldn't see the expected category.disable or similar method (or am I wrong?) so I guess the only way to disable the logging to a category would be to either wrap the use of the category with your own code (e.g. check is activi

Re: channels in Log4j

2001-07-27 Thread Sam Newman
I am still unsure as to what exactly you mean by channels - its a term I'm unfamiliar with in a logging context after having used both log4j and Jlog. Do you mean a channel in as much as being able to determine exactly where a log message came from, e.g. this DEBUG message came from User X? If so

Re: Multiple Appenders

2001-07-26 Thread Sam Newman
errnot sure if I understand you Ceki? As far as I can see I am sending plain text to the list - at least thats what Outlook says sam - Original Message - From: "Ceki Gülcü" <[EMAIL PROTECTED]> To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]> Sent: Thursday, July 26, 2001 12:28 P

Re: Design: How to do the following with Log4j

2001-07-26 Thread Sam Newman
My guess is that what should be done is that LoggingEvent should overide the serialization methods (writeObject & readObject) to use introspection to see of the message field's class implements the Serializable method. If so it gets written, if not it doesn't. This should only be a 30minute

Re: Design: How to do the following with Log4j

2001-07-26 Thread Sam Newman
You will of course need a decent ssocket server to view the events. Chainsaw is good (look on the downloads section on the log4j site) but apparently there are some associated performance issues, however someone suggested a fix for these on this list earlier (check a thread about 3 weeks back on S

Re: Design: How to do the following with Log4j

2001-07-26 Thread Sam Newman
Surely though you are only sending the string representation if you actually make your message a string? You can send any object you like as the message, e.g. cat.warn(new Integer()) or whatever. You then use the ObjectRenderers to convert this to a string representation. I could easily see you se

Re: Multiple Appenders

2001-07-26 Thread Sam Newman
Title: RE: Multiple Appenders The only way I can think of doing that would be to define 2 priority levels of your own choosing both with the same priority level - the use of prioritys with appenders explicitly says it will include all priorties and above because as far as its concerned nothin

Multiple Categories (was: Multiple Appenders)

2001-07-25 Thread Sam Newman
Is it worth including Mark's excellent example of using multiple Categories in the FAQ? sam - Original Message - From: <[EMAIL PROTECTED]> To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, July 25, 2001 3:34 PM Subject: Re: Multiple Appenders > > First thing the use of

Re: Multiple Appenders

2001-07-25 Thread Sam Newman
Naresh, I've just found this alternative to logging to different appenders given the priority - it comes straight from the log4j FAQ (http://jakarta.apache.org/log4j/docs/FAQ.html#filterByPriority to be exact) I should of checked it eariler myself!: "Setting the Threshold option of any appender

Re: Multiple Appenders

2001-07-25 Thread Sam Newman
Currently I use log4j via an abstracted static class. I have a method called warn, which does the following (it is a little aprroximated - don't have the code in from of me): public void warn(Class class, String message) { Category cat = Category.getInstance(class.getName()); cat.warn(message

Re: Multiple Appenders

2001-07-25 Thread Sam Newman
In as much as you can specify the priority level of a category from a proprties file, then yes. If you set the priortiy of a category catA to only log WARN level stuff, catA.debug() would still work, you just wouldn't get any output. sam - Original Message - From: "Naresh Sharma" <[EMAIL

Re: Multiple Appenders

2001-07-25 Thread Sam Newman
My understanding is that a priority level applies to the category, not the appenders. What about using 2 categories for the same hierarchy (I asume root), and then attach the FileAppender to one, and the SMTPAppender to the other? I actually want to use 2 categories for the same classes hierarchy

Re: XMLLayout and well formatted XML documents

2001-07-25 Thread Sam Newman
The source code for the XMLFileAppener is included with the distribution. You could edit it I guess this file and rename it or something (WellFormedXMLFileAppender?) - shouldn't be too hard. sam Krishnamurthy, Balaji (MED) Wrote: > > Hi folks, > > I started using log4j recently and have starte

Re: JMSAppender configuration

2001-07-24 Thread Sam Newman
You might want to try looking in the contrib directory in the distro. Its not specifically mentioned in the documentation (at least not that I could see), and it could do with a better index, but it might contain an example for you (I think its under the root on the installation, or perhaps under

Re: Problems to clear the log file at runtime

2001-07-19 Thread Sam Newman
ok - what I would suggest is to clear the file is that you: 1.) Disable the file appender 2.) Delete/move the file 3.) Renable the file appender You may of course potentially loose some logging info using this method if your application is multi-threaded. sam - Original Message - From: "

Re: Problems to clear the log file at runtime

2001-07-19 Thread Sam Newman
I'm not 100% sure what it is you want If you want to move the file before you start logging (e.g. you want to backup an old log before logging new information) then simply move the file before you configure logging. If you want to clear the file during the execution of the program, then couldn

Re: Designing Logging class

2001-07-17 Thread Sam Newman
> >> Will this help in logging messages to same logfile in an appserver > >> environment ( message: "Multiple JVMs writing to one log file"). For > >> the > >> same reason, i've used the static initializer to configure the logging > >> environment. Does this approach have any flaws? > > Well yes

Re: Designing Logging class

2001-07-17 Thread Sam Newman
I simply pass in the class of the object/static calling the abstract logger - e.g. LogFactory.getInstance().error(this.getClass(), "error!"); sam - Original Message - From: <[EMAIL PROTECTED]> To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]> Sent: Tuesday, July 17, 2001 5:56 PM Subject:

Re: Appender problem. Please help

2001-07-17 Thread Sam Newman
Hmm, that hits the boundary of my knowledge - I don't know anything about the JMSAppender itself! The problem I guess is that log4j is specifically designed not to throw exceptions, and it doesn't look like you can interogate an Appender to determine its state. All I can guess is that you'd want t

Re: Appender problem. Please help

2001-07-17 Thread Sam Newman
Sorry if I've missed the point of your email, or if any of this is super obviousbut anyhoo. I wrap my use of log4j up in a singleton object (implementing my interface Logger), e.g. I do something like this: Logger logger = Log4jLogger.getInstance(); getInstance() returns the only instance o

Configurator question

2001-07-13 Thread Sam Newman
Out of interest, what happens if I configure Log4j multiple times - e.g. if I called a PropertyConfigurator.configure twice, but using different properties? sam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional command

Re: Socket logging

2001-07-13 Thread Sam Newman
Thanks for everyones help. Oliver sent me a program he uses to test Chainsaw and it works fine. Now all I have to do if find out why mine doesn't work - and now I have a working program to compare my code to it should be very easy. I've moved to using a PropertiesConfigurator in anycase now, so it

Socket logging

2001-07-12 Thread Sam Newman
Hi all, I wanted to create a simple test program to try out the SocketAppender class in log4j. I decided to use the Chainsaw program to view to log events. I created 2 appenders, one console appender, and one socket appender. The socket appender is setup on the same port as chainsaw (in this inst