Re: e-mail logger?
There is already an SMTPAppender in log4j, and very handy it is too. http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/net/SMTPAppender.html cheers, Paul Smith On Thu, 2003-12-18 at 19:55, Charl Gerber wrote: Is there an implementation available (or planned) for a log4j e-mail logger? I would find it extremely usefull if my application would e.g. send me an e-mail every time an error occurs ... it is often impractical to keep monitoring logs all day log. Thanks. - 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: How-To get Log4Ant listed on Log4J Extensions?
Done. (Thanks to Ceki for fixing a permissions problem) On Mon, 2003-12-15 at 13:15, Wascally Wabbit wrote: At 08:55 PM 12/14/2003, you wrote: I've added this to the Xdocs of the site, but I need to confirm with Ceki on the exact process of getting the changes reflected on the actual website. cheers, Paul Thanks. The Wabbit - 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: How-To get Log4Ant listed on Log4J Extensions?
whoops, I thought you meant on the ant site, I think I can accomodate this. On Mon, 2003-12-15 at 12:40, Paul Smith wrote: I'd drop a line to the good folks over on the ant-user mailing list. I'm sure they can help you out. cheers, Paul Smith On Mon, 2003-12-15 at 12:34, Wascally Wabbit wrote: Can someone point-to/describe how we can get our Log4j-Ant tasks listed under Log4Ant in the Log4j extensions category on the log4j website? The information: shortnamelog4Ant/shortname descriptionlog4Ant includes a complete bridge to the Log4J logging system for a robust build monitoring system. These Ant components let you capture, map, and send Ant log messages and stdio output through your Log4J installation./description licenseGNU LGPL/license homepage http://purl.net/jware/antx/ /homepage contact[EMAIL PROTECTED]/contact Thanks, The Wabbit - 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: How-To get Log4Ant listed on Log4J Extensions?
I've added this to the Xdocs of the site, but I need to confirm with Ceki on the exact process of getting the changes reflected on the actual website. cheers, Paul On Mon, 2003-12-15 at 12:34, Wascally Wabbit wrote: Can someone point-to/describe how we can get our Log4j-Ant tasks listed under Log4Ant in the Log4j extensions category on the log4j website? The information: shortnamelog4Ant/shortname descriptionlog4Ant includes a complete bridge to the Log4J logging system for a robust build monitoring system. These Ant components let you capture, map, and send Ant log messages and stdio output through your Log4J installation./description licenseGNU LGPL/license homepage http://purl.net/jware/antx/ /homepage contact[EMAIL PROTECTED]/contact Thanks, The Wabbit - 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: Chainsaw:
It's the splitting of the events into different tabs, the frst one, tab highlighting, was related to what rules for highlighting are defined per tab. I think Scott Deboy has already done the saving of the colouring prefs, that should be working? The tab identifier preference is now available (thanks to Scott) from the View menu-Application-wide preferences. See the General tab of that preference panel, 'Tab Identifier'. The value you place in this field is a bit unclear at this early stage, but is an 'expression'. For example, the default is to look for 2 properties within each event to grab the hostname and the 'application'. Since these are defined within the LoggingEvent's Properties collection, it is referenced like this: PROP.hostname - PROP.application (hostname and application meaning to lookup the value of that key in the event's properties, you can configure the, say, SocketAppender to add the application property automatically) If you wanted a Tab for each Level, you could just use this expression: Level You can mix and match different event elements to come up with your own unique way of identifying which tab an event should get sent to. The docs on what expression elements are currently supported is here: http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/apache/log4j/chainsaw/LoggingEventFieldResolver.java (click on the first 'view' link to see the source, the javadoc should get you started) cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Thinking about log4j performance
In almost all cases this is correct, the logging done to the appender is all done within the same thread. Only the AsyncAppender performs it's appending in a separate thread. regards, Paul Smith On Thu, 2003-12-11 at 19:32, Yu Xiang Xi (Maveo) wrote: It's known that log4j has a good performance even 'on an AMD Duron clocked at 800Mhz running JDK 1.3.1' machine. If I have lot of appenders, for example, a socket appender, which will cost 0.1 second to communicate with the socket server, and there's still a file appender in the system all the same. My puzzle is that, will socket appender and file appender work at the same time? Or run socket appender first, and AFTER socket appender done, file appender later. And the system will hold on till all the appenders are invoked? Might it can be explained in the below assumption codes. Assumption methodA(); //(1) logger.debug(hello,log4j) //(2) hold on till all appenders are invoked one by one? methodB(); //(3) Best Regards Xi Yuxiang System Architect Maveo Systems Limited - www.maveosystems.com Email: [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: Dynamic Configuration
Problem 1: I think we'll need to see the code where you initialise the logger, and where you do the actual logging. Storing a local reference to the logger is fine, and the recommended practice. If you make it static, even better, I am not sure why you would want the GC to collect it. Problem 2: I have seen this message myself and might be due to some code logging at the same time as the new properties are being applied. If the configuration effectively changes an appenders configuration, log4j must stop/close the old appender before creating a new instance with the new config. Paul On Fri, 2003-12-12 at 10:34, Shimi Avizmil wrote: Anyone? I'm really lost here ... TIA -Original Message- From: Shimi Avizmil Sent: Thursday, 11 December 2003 3:29 PM To: '[EMAIL PROTECTED]' Subject:Dynamic Configuration Hi all, I spent few hours going through the past messages, but I couldn't find an answer to my problems. Problem 1: I have few ejbs under weblogic that get the log throught getClass().getName() and keep a copy locally. (Not static) My first problem is that the log messages are appearing under incorrect class name, i.e. 14:39:11,701 [main] INFO ejbA - I'm ejb B Why is that? problem 2: I wrote a swing gui that you can load a new properties file remotely to my app on the weblogic server and it calls PropertyConfigurator.configure(props) with the new properties. After I do that I get a lot of ERRORS: trying to append to a closed appender... Why does that happen? is that because I cache the logger reference in stead of fetching it every time? should I make it static? if I'll make it static, will it effect the gc from collecting it? Thanks for the help. Cheers Shimi - 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: Dynamic Configuration
On Fri, 2003-12-12 at 10:59, Shimi Avizmil wrote: First of all thanks for the reply ! Problem 1: private Log log = MySystem.getLog(getClass().getName()); I'm not talking about gc the logger, I'm talking about a case where if I have an object that has a static logger reference, and this object is not used anymore, will this object get gced? I don't think so...if it won't, I don't think it's a good practice to keep a static reference. When you have: private static final Logger LOG = Logger.getLogger(TheClass.class); The LOG instance is kept with the _class_ and not with the instance of the class, and hence will have no bearing on the GC'ing of the instance(s). Each instance does not hold onto refs of static vars, but has access to them when needed via it's Class instance. I'm still not clear about this one. I saw in one of the archive messages that changing the appenders is not supported, is this true? I tweak the appenders of our App through a property file all the time, and it dynamically closes, creates a new appender and configures it without a server restart. I do this a lot. It's not a problem. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamic Configuration
Problem 2: You mentioned that you get those messages as well sometimes, do you know why? It is possible that there might be some synchronization problem at the point of the call to a specific appender's close() method, and during the close, some logs try and come through to be appended. What type of Appender are you using (FileAppender? Daily*Appender?), and what version of log4j are you using? (the latest is log4j 1.2.8) cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Chainsaw]: Ant-based installer
Hi all, We are getting closer and closer to releasing log4j 1.3 (and yes, we will get there). In the mean time if anyone is slightly curious about the new Chainsaw v2 that will be a part of this release, I have written an Ant-based 'installer' that takes a lot of the effort required to get everything that is needed for it. (see the attached file) Chainsaw v2 is stable and very useful right now, with a number of people using it everyday for production use (monitoring sites using log4j 1.2.7+). We are just adding more features to make it more enterprise ready. To run this installer, you need installed: * Ant * CVS This script just checks out the latest jakarta-log4j cvs module to your local machine, downloads some other required bits and pieces, and sets up some configs. You can run the installer by saving the attached xml file to a directory where you would like Chainsaw installed, and typing: ant -f install-chainsaw.xml and follow the prompts. After the installation, you can cd into the jakarta-log4j directory and 'ant chainsaw' to run Chainsaw v2. This script can be run at any time to update what has been downloaded so you can toy with the latest version whenever you wish. Feel free to ask questions on this list if you have any problems or thoughts. cheers, Paul Smith project name=install-chainsaw default=install basedir=. property name=module.dir location=${basedir}/ property name=oro.file.name value=jakarta-oro-2.0.7.zip / property name=oro.location location=${module.dir}/${oro.file.name} / property name=oro.unzip.location location=${module.dir}/ / target name=install depends=confirm,cvs,get-oro,create-build-properties, success-msg/ target name=confirm depends= echo CHAINSAW v2 installer This Ant build script will perform the following: * Download the jakarta-log4j module from the Apache CVS * Dowload the latest binary version of the Jakarta ORO project from www.ibiblio.org It will create the following artifacts in the current directory (whereever this Ant script is) * a jarkarta-log4j directory, containing the log4j source tree * a jakarta-oro-2.0.7.zip file * a jakarta-oro-2.0.7 directory containing the unpacked ORO jar from the aforementioned zip file /echo input message=Are you OK with all of this? validargs=y,n addproperty=confirm / condition property=do.abort equals arg1=n arg2=${confirm}/ /condition fail if=do.abortInstallation aborted by user./fail /target target name=cvs depends= cvs cvsRoot=:pserver:[EMAIL PROTECTED]:/home/cvspublic package=jakarta-log4j dest=${module.dir} quiet=true / /target target name=get-oro depends= !-- echo${oro.location}/echo -- get src=http://www.ibiblio.org/pub/mirrors/apache/jakarta/oro/${oro.file.name}; dest=${oro.location} verbose=true usetimestamp=true/ unzip src=${oro.location} dest=${oro.unzip.location} patternset include name=jakarta-oro-2.0.7/jakarta-oro-2.0.7.jar/ /patternset /unzip /target target name=create-build-properties depends= copy file=${module.dir}/jakarta-log4j/build.properties.sample tofile=${module.dir}/jakarta-log4j/build.properties /copy replace file=${module.dir}/jakarta-log4j/build.properties replacetoken![CDATA[#regexp.oro.jar=../oro/jakarta-oro-2.0.6.jar]]/replacetoken replacevalue![CDATA[regexp.oro.jar=../jakarta-oro-2.0.7/jakarta-oro-2.0.7.jar]] /replacevalue /replace /target !--target name=clean depends= /target-- target name=success-msg depends= echo Installation completed successfully. You should now be able to do the following to run Chainsaw v2: cd jakarta-log4j ant chainsaw GOOD LUCK! /echo /target /project - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Chainsaw]: Ant-based installer
One initial comment tho, is there a way to list the full ignore list in a table or something. I'm playing with our app and ignoring some loggers, now want to see which ones I'm ignoring. I know that they are italliced in the tree, but our tree is large, and I've only ignored a few.. Is there a quick way to see what is ignored. Maybe a popup dialog or inline panel under the logger tree that could be shown/hidden, with a list of loggers (full dotted package name) on the ignore list, which you can uncheck? Glad to hear that the installer worked a treat. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Chainsaw]: Ant-based installer
One other options might be to just hide/show items that are ignored in the tree, then with an expand all option, you don't even need a new ui. Right now you can ignore a specific logger, but that doesn't imply that it should ignore all it's children as well, so if we hide a logger node in the tree, it removes the ability to manage the children (all the children nodes won't be visible). Creating a new panel would be easy anyway. Then I'm sure at a later date the idea of showing/hiding loggers based on some sort of constraint could be re-used. Do you have a certain style of constraint in mind here? Be good to have all this in the back of my mind as I'm developing. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Chainsaw]: Ant-based installer
I noticed that behaviour, is there a reason. It's a bit annoying to have to turn off each sub-logger. When configuring loggers, if you set a logger to FATAL, then all sub-loggers are converted to FATAL, right?? Shouldn't chainsaw replicate this idea. Most times nodes in a logger tree are packages, while the leaves are actual classes. It would be nice to ignore an entire package, like utils or something. I can see both cases, but wondered why you went with explicit logger ignoring.. Had thought of this, but imagine you had wanted to ignore a top level package, but not the children It needs some more work to handle both cases. Be nice to have a Ignore + all children, and the reverse... We'll get there. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: chainsaw v2
On Tue, 2003-12-09 at 00:54, [EMAIL PROTECTED] wrote: hi paul and scott, is it possible to implement a dialog to confirm that the user wants to exit der chainsaw v2 app (perhaps an JOptionPane)? It's certainly possible, we elected to not bother with this as it is generally infrequent that a user would exit accidently. Are we mistaken? At any rate, there will be some Global application settings added to Chainsaw at some point and I am certain this one could be added. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am not getting stack trace from logger.error(error,e)?
Depends how you log your stacktrace. If you log like this: private static final Logger LOG = Logger.getLogger(.); ... try { } catch(Exception e) { LOG.error(e); } Then you WILL only get the error message without the rest of the stack trace. The reason is that the exception is going to the loggers.error(Object) method, and Log4j is simply calling the .toString() on the Exception object. This is a common mistake, and I've forgotten this several times myself. What you really need to do is: LOG.error(An error happened here, e); This will ensure that the full stacktrace is output (assuming that the JDK 1.4.2 doesn't still get you) cheers, Paul Smith On Tue, 2003-12-09 at 07:23, struts wrote: I am also getting the similiar problem. Just I was able to see the stack trace in the console, but in the database, I can just see the error message without stack trace. Attached is my log4j.xml file. Anybody knows why? Thanks. Song Robert Augustyn [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paul, Thanks, I am running 1.4.2 vm and it does not look like it's fixed... It is real pain!. robert -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2003 7:02 PM To: Log4J Users List Subject: RE: I am not getting stack trace from logger.error(error,e)? On Fri, 2003-11-28 at 10:45, Robert Augustyn wrote: Hi Ceki, I am getting just one line like: Java.NullPointerException: This maybe only a very slight possibility, but I have seen exactly what you are describing in our production environment when we are using the -server option under the Sun 1.4.2 JDK under Linux (no JBoss though). Just a single line with no more information. See this bug: http://developer.java.sun.com/developer/bugParade/bugs/4761344.html They say it is fixed in 1.4.2, and while it does not happen with the frequency it used to, it's one to look out for. Not using the -server option seems to help, although you lose some performance there. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] begin 600 log4j.xml M/#]X;[EMAIL PROTECTED]VEO;CTB,2XP(B!E;F-O9EN9STB551[EMAIL PROTECTED]/SX-CPA1$]# M5%E012!L;VT:CIC;VYF:6=UF%T:6]N(%-94U1%32`B;]G-HN9'1D(CX- MCQL;VT:CIC;VYF:6=UF%T:6]N('AM;YS.FQO9S1J/2)H='1P.B\O:F%K M87)T82YA%C:4N;W)G+VQO9S1J+R(@95B=6](F9A;'-E(CX-@T*(`\ M87!P96YD97(@;F%M93TB1DE,12(@8VQAW,](F]R9RYJ8F]SRYL;V=G:6YG M+F%P5N95R+D1A:6QY4F]L;EN9T9I;5!'!E;F1EB(^#0H@(`@/'!A MF%M(YA;64](E1HF5S:]L9(@=F%L=64](D524D]2(B\^#0H@(`@/'!A MF%M(YA;64](D9I;4B('9A;'5E/2(DVIB;W-S+G-EG9EBYH;VUE+F1I MGTO;]G+W-EG9EBYL;VB+SX-B`@(`\%R86T@;F%M93TB07!P96YD M(B!V86QU93TB=')U92(O/@T*(`@(#QP87)A;2!N86UE/2)$871E4%T=5R M;B(@=F%L=64](BN)WEY7DM34TM90B+SX-B`@(`\;%Y;W5T(-L87-S M/2)OFN87!A8VAE+FQO9S1J+E!A='1EFY,87EO=70B/@T*(`@(`@/'!A MF%M(YA;64](D-O;G9EG-I;VY0871T97)N(B!V86QU93TB)60@)2TU!; M)6-=(5M)6XB+SX-B`@(`\+VQA6]U=#X)(`@(`T*(`\+V%P5N95R M/@T*(`)#0H@(`@/%P5N95R(YA;64](DI$0D,B(-L87-S/2)C;VTN M='5M8FQE=V5E9YM97-S96YG97(N;]G9VEN9RY-97-S96YG97)*1$)#07!P M96YD97(B/@T*(`@(#QP87)A;2!N86UE/2)4:')EVAO;0B('9A;'5E/2)% M4E)/4B(O/@T*(`@(#QP87)A;2!N86UE/2)S6PB(`T*(`@(`@(!V86QU M93TB:6YS97)T(EN=[EMAIL PROTECTED];G1,;V=%=F5N=',@*`T*(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E=F5N=%1Y4L0D) M0D)0D)0T*(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(!E=F5N=$UA8VAI;F4L#0H@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(5V96YT5[EMAIL PROTECTED]@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(5V96YT240L(`T* M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E M=F5N=$QE=F5L+`D-B`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@([EMAIL PROTECTED];G1#871E9V]R2P-B`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@([EMAIL PROTECTED]]N96YT3F%M92P-B`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@([EMAIL PROTECTED] M;G1#;%STE$+`T*(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(!E=F5N=$-L87-S15S8W)I'1I;VXL(`T*(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E=F5N=$1E=%I M;',-B`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`I#0H@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!V86QU M97,@*`-B`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@)7`L(`T*(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`C5$]+14Y?159%3E1?34%#2$E.15].04U%([EMAIL PROTECTED]@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(,E9'M- M32]D9]Y7EY($A(.FUM.G-S?2,L(`T*(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`C)6,C+`-B`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@,[EMAIL PROTECTED]@(`@(`@(`@ M
Re: I am not getting stack trace from logger.error(error,e)?
D'oh... I am assuming from the subject line that you are already doing this. Perhaps I should have paid more attention. Sorry for the waste of bandwidth. I'll now go and make my first coffee of the day to minimise the risk of my foot getting anywhere near my mouth again. cheers, Paul On Tue, 2003-12-09 at 08:11, Paul Smith wrote: Depends how you log your stacktrace. If you log like this: private static final Logger LOG = Logger.getLogger(.); ... try { } catch(Exception e) { LOG.error(e); } Then you WILL only get the error message without the rest of the stack trace. The reason is that the exception is going to the loggers.error(Object) method, and Log4j is simply calling the .toString() on the Exception object. This is a common mistake, and I've forgotten this several times myself. What you really need to do is: LOG.error(An error happened here, e); This will ensure that the full stacktrace is output (assuming that the JDK 1.4.2 doesn't still get you) cheers, Paul Smith On Tue, 2003-12-09 at 07:23, struts wrote: I am also getting the similiar problem. Just I was able to see the stack trace in the console, but in the database, I can just see the error message without stack trace. Attached is my log4j.xml file. Anybody knows why? Thanks. Song Robert Augustyn [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Paul, Thanks, I am running 1.4.2 vm and it does not look like it's fixed... It is real pain!. robert -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2003 7:02 PM To: Log4J Users List Subject: RE: I am not getting stack trace from logger.error(error,e)? On Fri, 2003-11-28 at 10:45, Robert Augustyn wrote: Hi Ceki, I am getting just one line like: Java.NullPointerException: This maybe only a very slight possibility, but I have seen exactly what you are describing in our production environment when we are using the -server option under the Sun 1.4.2 JDK under Linux (no JBoss though). Just a single line with no more information. See this bug: http://developer.java.sun.com/developer/bugParade/bugs/4761344.html They say it is fixed in 1.4.2, and while it does not happen with the frequency it used to, it's one to look out for. Not using the -server option seems to help, although you lose some performance there. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] begin 600 log4j.xml M/#]X;[EMAIL PROTECTED]VEO;CTB,2XP(B!E;F-O9EN9STB551[EMAIL PROTECTED]/SX-CPA1$]# M5%E012!L;VT:CIC;VYF:6=UF%T:6]N(%-94U1%32`B;]G-HN9'1D(CX- MCQL;VT:CIC;VYF:6=UF%T:6]N('AM;YS.FQO9S1J/2)H='1P.B\O:F%K M87)T82YA%C:4N;W)G+VQO9S1J+R(@95B=6](F9A;'-E(CX-@T*(`\ M87!P96YD97(@;F%M93TB1DE,12(@8VQAW,](F]R9RYJ8F]SRYL;V=G:6YG M+F%P5N95R+D1A:6QY4F]L;EN9T9I;5!'!E;F1EB(^#0H@(`@/'!A MF%M(YA;64](E1HF5S:]L9(@=F%L=64](D524D]2(B\^#0H@(`@/'!A MF%M(YA;64](D9I;4B('9A;'5E/2(DVIB;W-S+G-EG9EBYH;VUE+F1I MGTO;]G+W-EG9EBYL;VB+SX-B`@(`\%R86T@;F%M93TB07!P96YD M(B!V86QU93TB=')U92(O/@T*(`@(#QP87)A;2!N86UE/2)$871E4%T=5R M;B(@=F%L=64](BN)WEY7DM34TM90B+SX-B`@(`\;%Y;W5T(-L87-S M/2)OFN87!A8VAE+FQO9S1J+E!A='1EFY,87EO=70B/@T*(`@(`@/'!A MF%M(YA;64](D-O;G9EG-I;VY0871T97)N(B!V86QU93TB)60@)2TU!; M)6-=(5M)6XB+SX-B`@(`\+VQA6]U=#X)(`@(`T*(`\+V%P5N95R M/@T*(`)#0H@(`@/%P5N95R(YA;64](DI$0D,B(-L87-S/2)C;VTN M='5M8FQE=V5E9YM97-S96YG97(N;]G9VEN9RY-97-S96YG97)*1$)#07!P M96YD97(B/@T*(`@(#QP87)A;2!N86UE/2)4:')EVAO;0B('9A;'5E/2)% M4E)/4B(O/@T*(`@(#QP87)A;2!N86UE/2)S6PB(`T*(`@(`@(!V86QU M93TB:6YS97)T(EN=[EMAIL PROTECTED];G1,;V=%=F5N=',@*`T*(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E=F5N=%1Y4L0D) M0D)0D)0T*(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(!E=F5N=$UA8VAI;F4L#0H@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(5V96YT5[EMAIL PROTECTED]@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(5V96YT240L(`T* M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E M=F5N=$QE=F5L+`D-B`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@([EMAIL PROTECTED];G1#871E9V]R2P-B`@(`@(`@(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@([EMAIL PROTECTED]]N96YT3F%M92P-B`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@([EMAIL PROTECTED] M;G1#;%STE$+`T*(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@ M(`@(`@(`@(!E=F5N=$-L87-S15S8W)I'1I;VXL(`T*(`@(`@(`@ M(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(`@(!E=F5N=$1E=%I M
Re: Chainsaw
On Tue, 2003-12-09 at 08:49, eugene akerman wrote: Hi Scott, Hi Paul So I am looking at chainsaw and it looks great. I was using LogFactor until now but I feel I should go with Chainsaw. Is it possible to get an historic point of view on Chainsaw. For example Why did you guys decide to work on chainsaw as opposed to logFactor ? Thank you for your answer For me personally, I found the original Chainsaw on SourceForge, and then found it had become part of the log4j package, so I guess I had become accustomed to Chainsaw, and had some affinity for it. LogFactor5 is great, there's no doubt about it. Since the Receiver framework was added to log4j, we've been able to leverage a lot of log4j core code. If you look at the code for Chainsaw v2 and compare it with the original, there is not a lot left of the original apart from some of the basic principles, and one might say in hindsight it might have been quicker to start from scratch, but that wouldn't be as fun. In some ways it has been like a house renovation. It has had some walls knocked out, floors sanded laquered, painted, a new kitchen, a brand new deck out the front, and had some new furniture put in. Still feels like the old place, only newer. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can we control the logging level to class level instead of package level?
you'll need to switch additivity off for the logger you want disabled, otherwise the LoggingEvent gets passed up the logger hierarchy to the root logger The short manual has info on this: http://jakarta.apache.org/log4j/docs/manual.html (see the bit on additivity) But when you get Ceki's book, that'll help even more. Paul On Tue, 2003-12-09 at 13:02, Song wrote: It seems that root config will override the logger config, is this true? Give the following configuration, I still see error event from EventLoggerSessionEJB logged into database. But if I change the logging level from 'INFO' to 'FATAL', the event will not be logged. Here is part of my log4j config: logger name=com.tumbleweed.messenger.server.ejb.impl.EventLoggerSessionEJB level value=INFO/ appender-ref ref=CONSOLE/ /logger root appender-ref ref=CONSOLE/ appender-ref ref=FILE/ appender-ref ref=JDBC/ appender-ref ref=NTEventLog/ /root Thanks. Song Scott Heaberlin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Certainly - you could define a logger with the name of the class itself, then effectively squelch it: via DOMConfigurator: logger name=com.mycompany.myproduct.MyClass additivity=false level value=FATAL/ !-- I believe you can also specify NONE -- /logger logger name=com.mycompany.myproduct level value=DEBUG/ appender-ref ref=SomeAppender/ /logger root level value=DEBUG/ appender-ref ref=MyAppender/ /root You can achieve similar results with PropertyConfigurator (see the online log4j manual) or, shamelessplug check out The Complete Log4j Manual by Ceki Gulcu /shamelessplug -Scott Heaberlin -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Song Sent: Monday, December 08, 2003 7:48 PM To: [EMAIL PROTECTED] Subject: Can we control the logging level to class level instead of package level? Hi, Can I do something like this : For specific class in certain package, don't log the event using specific appender while allowing other classes in the same package to do that? Thanks. Song - 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: chainsaw v2
re: multiselecting and stopping receivers. That's a fair call, I hadn't thought of that situation, it should be straight forward. Thanks also for the note on the NPE on the welcome Tab, I think I know what that is. Also, I am not sure what you mean by right clicking 'next to' a tab. Could you expand a bit more for me? cheers, and thanks for the feedback, keep it coming. cheers, Paul Smith -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 12/4/03 6:40 PM Subject: chainsaw v2 hi paul, yesterday i tested the changes you made. the custom timestamp format is exactly what i was looking for. well done. another cool feature would be : if you select more than on receiver in the receiver panel and you press the stop button, all the selected receivers have to stop. it is not a very important thing but could be very handy if you have more receivers running (like me). the context menu on the tabs is also exactly what i was wanted. if you right click besides a tab you could get also get an context menu? i don't know if it is a known issue : if you right click on the welcome tab and close it then you get an npe. here is the stacktrace : java.lang.NullPointerException at org.apache.log4j.chainsaw.LogUI$2.actionPerformed(Unknown Source) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractB utto n.java:1839) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.ja va:4 20) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.AbstractButton.doClick(AbstractButton.java:289) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113 ) at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(B asic MenuItemUI.java:943) at java.awt.Component.processMouseEvent(Component.java:5100) at java.awt.Component.processEvent(Component.java:4897) at java.awt.Container.processEvent(Container.java:1569) at java.awt.Component.dispatchEventImpl(Component.java:3615) at java.awt.Container.dispatchEventImpl(Container.java:1627) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128) at java.awt.Container.dispatchEventImpl(Container.java:1613) at java.awt.Window.dispatchEventImpl(Window.java:1606) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea d.ja va:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread. java :151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) - 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]
FW: chainsaw v2
[forgot to send this to the list] -Original Message- From: Paul Smith To: '[EMAIL PROTECTED] ' Sent: 12/4/03 9:41 PM Subject: RE: chainsaw v2 Ulrich, the bug you mentioned, plus the feature you requested are now done, and available from cvs. cheers, Paul Smith -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 12/4/03 6:40 PM Subject: chainsaw v2 hi paul, yesterday i tested the changes you made. the custom timestamp format is exactly what i was looking for. well done. another cool feature would be : if you select more than on receiver in the receiver panel and you press the stop button, all the selected receivers have to stop. it is not a very important thing but could be very handy if you have more receivers running (like me). the context menu on the tabs is also exactly what i was wanted. if you right click besides a tab you could get also get an context menu? i don't know if it is a known issue : if you right click on the welcome tab and close it then you get an npe. here is the stacktrace : java.lang.NullPointerException at org.apache.log4j.chainsaw.LogUI$2.actionPerformed(Unknown Source) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractB utto n.java:1839) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.ja va:4 20) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.AbstractButton.doClick(AbstractButton.java:289) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1113 ) at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(B asic MenuItemUI.java:943) at java.awt.Component.processMouseEvent(Component.java:5100) at java.awt.Component.processEvent(Component.java:4897) at java.awt.Container.processEvent(Container.java:1569) at java.awt.Component.dispatchEventImpl(Component.java:3615) at java.awt.Container.dispatchEventImpl(Container.java:1627) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128) at java.awt.Container.dispatchEventImpl(Container.java:1613) at java.awt.Window.dispatchEventImpl(Window.java:1606) at java.awt.Component.dispatchEvent(Component.java:3477) at java.awt.EventQueue.dispatchEvent(EventQueue.java:456) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThrea d.ja va:201) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread. java :151) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137) at java.awt.EventDispatchThread.run(EventDispatchThread.java:100) - 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: Antwort: Re: Antwort: RE: timestamp in chainsaw v2
Yes, I know exactly what you mean, I'll add it to the list of things. THanks. Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, 3 December 2003 5:52 PM To: Log4J Users List Subject: Antwort: Re: Antwort: RE: timestamp in chainsaw v2 cool, thanks Paul. tonight i will take look at it and let you know. another feature which comes to my mind : double click on the border line between two columns sizes the column to its optimal width. like in excel. i have problems to describe this behaviour in english, so ask me again if you don't understand what i mean. servus uli Paul Smith [EMAIL PROTECTED]An: Log4J Users List [EMAIL PROTECTED] x.com.auKopie: Thema:Re: Antwort: RE: timestamp in chainsaw v2 03.12.03 03:35 Bitte antworten an Log4J Users List another feature i think would be useful could be: right click on the tab would open a context dialog where you could close the tab. the same function as you would : View-Display Tabs-... Ulrich, this feature also managed to get done today. Right click on a tab to see the popup. The old View-Display Tabs has been removed in favour of the new feature, and we'll eventually have a separate 'Window' top level menu to assist in the managing of all Tabs and undocked windows. Let me know what you think. cheers, Paul Smith - 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: timestamp in chainsaw v2
At this stage there is no way to do it via the GUI, but we do have plans to add this feature before release. Internally this is how it is accomplished, but we decided to initially have a few likely options as simple choices. there will definately be a custom option. Maybe I can slip this feature in earlier since you are using chainsaw v2 already. Let us know if there is anything else you are passionate about, or if you find any issues. cheers, Paul Smith -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 12/2/03 6:39 PM Subject: timestamp in chainsaw v2 hi guys, what i am missing in chainsaw v2 is the possibility to define the timestamp mask. in the log panel preferences you can only specify three different timestamp masks. is there any way to define your own timestamp mask like dd.MM. HH:mm:ss or am i missing something? servus uli - 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: additivity trouble
You have attached the console appender to the logger you wish to ignore, in this line: log4j.category.fr.MyClass=INFO, console This means that any INFO message for that logger will go to the console appender, which really means that this entry is redundant. What I think you want is to modify this line: log4j.category.fr.MyClass=INFO, console to either: log4j.category.fr.MyClass=OFF or: log4j.category.fr.MyClass=INFO The former is more efficient since logs will be ignored at an earlier stage, while the latter means that INFO and above are 'accepted', but since there is no logger attached (and additivity is off) they do not end up anywhere. Hope that helps. cheers, Paul Smith -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 12/2/03 7:31 PM Subject: additivity trouble Hello everybody, I'm using a root category for all the logs and i want to exclude a class from these logs, here is my log4j.properties file log4j.rootCategory=INFO, console log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%-5p [%t] %40c %x - %m%n log4j.category.fr.MyClass=INFO, console log4j.additivity.fr.MyClass=false This doesn't work. Can someone help me? Thanks in advance... Ahmed ALAMI SDV (Support Outils Dévellopement NTIC) Tel : 05 57 75 60 52 JUST GEEK CODE -BEGIN GEEK CODE BLOCK- Version: 3.12 GCM d s+: a C+ UL++ P L++ E++ W++ N++ o K- w O M- V- PS++ PE+ Y+ PGP+ t 5 X R tv+ b+++ DI+ D G++ e+++ h+ r++ x+ --END GEEK CODE BLOCK-- -BEGIN JAVA GEEK CODE BLOCK- Version: 0.01b Epvbdemon+++()@$* --END JAVA GEEK CODE BLOCK-- ATT108217.txt ATT108218.txt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: RE: timestamp in chainsaw v2
another feature i think would be useful could be: right click on the tab would open a context dialog where you could close the tab. the same function as you would : View-Display Tabs-... Ulrich, this feature also managed to get done today. Right click on a tab to see the popup. The old View-Display Tabs has been removed in favour of the new feature, and we'll eventually have a separate 'Window' top level menu to assist in the managing of all Tabs and undocked windows. Let me know what you think. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: DailyRollingFileAppender with filesize option
Hi Carsten, It is my understanding, and I may be wrong here, that Ceki has completely rewritten the whole rolling appender framework to allow much more flexibility in the composition of different rules for rolling. This unfortunately not in the released version at this time, but the 1.3 release is not that far away. We appreciate your contribution, perhaps you could attach the files to a bug item (if you haven't done so already), so that your efforts don't get lost if my understanding is not correct. cheers, Paul Smith On Mon, 2003-12-01 at 20:57, Bansemir, Carsten wrote: Hi, some time ago i wrote the following to the log4j-dev mailing list: Hi, I had several problems with the DailyRollingFileAppender (see user mailing list), so I downloaded the DailyRollingAppenderExt.jar but I can't find the source of this file again (so I also can't find out the author of this Class). I extended this class so that the Appender rolls by date AND by size, like the CompositeRollingFileAppender does, with the difference that it logs to a different file every day, without having to rename any files (that was the problem with threads logging to yesterday's dir because the Java method renameTo() fails in the RollingFileAppender or the CompositeRollingFileAppender. My question is: Are you interested in this Appender? and if so, do you know who the original author of DailyRollingFileAppenderExt was? I would like to give this appender out to the people searching for something like that in the mailing list, it's almost an FAQ, but I would like to ask the original author before. So if someone finds out the the author of the original DailyRollingFileAppenderExt please tell me, that I can give out the modified one to the people who want it. -Ursprngliche Nachricht- Von: Manju Joseph [mailto:[EMAIL PROTECTED] Gesendet: Sonntag, 30. November 2003 03:08 An: [EMAIL PROTECTED] Betreff: Fwd: DailyRollingFileAppender with filesize option Hello.., Me too getting the same error.Can any one help MANJU From: Divya Shetty [EMAIL PROTECTED] Reply-To: Log4J Users List [EMAIL PROTECTED] To: Log4J Users List [EMAIL PROTECTED] Subject: DailyRollingFileAppender with filesize option Date: Sat, 29 Nov 2003 14:30:46 +0530 In the CompositeRollingAppender, the reference made to setFile provides a String and boolean as parameter while the setFile in FileAppender which accepts two arguments expects Layout and Boolean. Hence am unable to compile ti.. None in our project has used log4J before and the lack of time is causing to be a deterent in workign it out for ourselves. Would it be possible to either download the CompositeRollingAppender.class or the jar which has been updated with the CompositeRollingAppender.class ? - Original Message - From: Divya Shetty To: Log4J Users List Sent: Saturday, November 29, 2003 1:32 PM Subject: Fw: DailyRollingFileAppender with filesize option I downloaded log4j-1.2.8.jar. Along with this i found the CompositeRollingAppender.java in the contributions folder. In this file, on line 362 the method super.setFile(fileName, append) is called. In the FileAppender, there is no overloaded method where only two arguments are provided and hence it fails in the compilation. Is this a known issue or has someone already resolved it? Thanks Divya - Original Message - From: Divya Shetty To: Log4J Users List Sent: Saturday, November 29, 2003 11:00 AM Subject: DailyRollingFileAppender with filesize option Hi, I have the following log4j property file: log4j.rootLogger=debug, A log4j.logger.SickPay=debug, SP log4j.appender.SP=org.apache.log4j.DailyRollingFileAppender log4j.appender.SP.File=COMMON~1\\Trial\\SP.log log4j.appender.SP.MaxFileSize=1KB log4j.appender.SP.MaxBackupIndex=6 log4j.appender.SP.layout=org.apache.log4j.PatternLayout log4j.appender.SP.layout.ConversionPattern=%d ::%m%n I need to roll over the file on basis of both the date and Size of the file. When i run the application it gives me the compilation error: log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender. log4j:WARN No such property [maxFileSize] in org.apache.log4j.DailyRollingFileAppender. I checked the Mail list archive and there was a suggestion that one use CompositeRollingFileAppender. Where can i find CompositeRollingFileAppender? Could anyone suggest a way to implement this? Regards, Divya Shetty _ BharatMatrimony.com. http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 India's premium matrimonial website. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: How stable is Chainsaw 2?
I have to say that that is bizarre. Are you saying after running this that there is no log4j-chainsaw-1.3alpha.jar in the root of your jakarta-log4j directory? What JDK are you using, and what version of Ant are you using? (I notice that by your paths you have an interesting JDK, jdev905preview? or is this being done via a GUI IDE? If so I would recommend trying to run chainsaw from the command line first. BTW, I am in the GMT +10 timezone, so apologise for any lag in communication. cheers, Paul Smith -Original Message- From: Robert Augustyn To: 'Log4J Users List' Sent: 11/29/03 4:40 PM Subject: RE: How stable is Chainsaw 2? Paul, This is an output I get. :\java\jdev905preview\jdk\bin\javaw.exe -classpath H:\java\jdev905preview\jdk\lib\tools.jar;H:\cvs\jakarta-log4j\dist\class es;H:\java\jdev905preview\jdev\lib\ant.jar;H:\java\jdev905preview\jdev\l ib\optional.jar;H:\java\jdev905preview\lib\xmlparserv2.jar;H:\java\jdev9 05preview\lib\xmlcomp.jar;H:\java\jdev905preview\jdev\classes;H:\java\jd ev905preview\ide\lib\javatools.jar;H:\java\jdev905preview\ide\lib\ide.ja r;H:\java\jdev905preview\jdev\lib\jdev.jar;H:\java\jdev905preview\jdev\l ib\ojc.jar org.apache.tools.ant.Main -Djdev.home=H:\java\jdev905preview -buildfile H:\cvs\jakarta-log4j\build.xml chainsaw Buildfile: H:\cvs\jakarta-log4j\build.xml init: oroCheck: chainsawCheck: build.core: [mkdir] Created dir: H:\cvs\jakarta-log4j\dist\classes [javac] Compiling 199 source files to H:\cvs\jakarta-log4j\dist\classes build.chainsaw: build.lf5: [javac] Compiling 44 source files to H:\cvs\jakarta-log4j\dist\classes [javac] Note: H:\cvs\jakarta-log4j\src\java\org\apache\log4j\lf5\viewer\LogBrokerMonit or.java uses or overrides a deprecated API. [javac] Note: Recompile with -deprecation for details. [copy] Copying 3 files to H:\cvs\jakarta-log4j\dist\classes build.examples: [mkdir] Created dir: H:\cvs\jakarta-log4j\examples\classes [javac] Compiling 12 source files to H:\cvs\jakarta-log4j\examples\classes [rmic] RMI Compiling 1 class to H:\cvs\jakarta-log4j\examples\classes jaxpCheck: jaxp: [echo] JAXP present. build.xml: [javac] Compiling 7 source files to H:\cvs\jakarta-log4j\dist\classes [copy] Copying 1 file to H:\cvs\jakarta-log4j\dist\classes\org\apache\log4j\xml [copy] Copying 1 file to H:\cvs\jakarta-log4j\dist\classes\org\apache\log4j\xml javamailCheck: javamail: [echo] JAVAMAIL is present. build.javamail: [javac] Compiling 1 source file to H:\cvs\jakarta-log4j\dist\classes jmsCheck: jms: jndiCheck: jndi: [echo] JNDI is present. build.jms: jmxCheck: jmx: build.jmx: avalonFrameworkCheck: avalonFramework: build.avalonFramework: build: log4j.jar: [delete] Deleting 1 files from H:\cvs\jakarta-log4j [jar] Building jar: H:\cvs\jakarta-log4j\log4j-1.3alpha.jar log4j-chainsaw.jar: [delete] Deleting 1 files from H:\cvs\jakarta-log4j [copy] Copying 71 files to H:\cvs\jakarta-log4j\dist\classes [jar] Building jar: H:\cvs\jakarta-log4j\log4j-chainsaw-1.3alpha.jar chainsaw: [java] java.lang.NoClassDefFoundError: org/apache/log4j/chainsaw/LogUI [java] Exception in thread main [java] Java Result: 1 BUILD SUCCESSFUL Total time: 16 seconds [12:38:01 AM] Nothing to build. -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Friday, November 28, 2003 10:41 PM To: 'Log4J Users List ' Subject: RE: How stable is Chainsaw 2? Not from what I can see. Only build.properties is loaded. build.properties.sample is ignored and is only used as a template. Jake, you are correct. I must be thinking of another project. Robert, we'll definately need to see the output of the ant target as it runs. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.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: How stable is Chainsaw 2?
It should have created 3 jar files, one with chainsaw in it's name. Ant may be ignoring chainsaw's build phase because you are missing some dependant jars. Have you edited the build.properties.sample? (I've found that you have to make sure there is not BOTH a build.properties.sample and a build.properties, the build picks up the former first.) Otherwise cut/paste the output of the full build to the list so we can see what is going on. cheers, and thanks for taking the time to have a look at chainsaw v2. Paul -Original Message- From: Robert Augustyn To: 'Log4J Users List' Sent: 11/29/03 8:04 AM Subject: RE: How stable is Chainsaw 2? Paul, I downloaded it and run it. It created 2 jar files but neither has logUI in it so when it tries to start it gets : ava.lang.NoClassDefFoundError: org/apache/log4j/chainsaw/LogUI None of Chainsaw classes get created either. Robert -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Friday, November 28, 2003 2:04 AM To: 'Log4J Users List' Subject: RE: How stable is Chainsaw 2? It's very stable, and very usable with features be added all the time, but the current functionality is very usable (I might be biased, I am one of the developers of the new version) You will need to download the jakarta-log4j module from the apache cvs, you can find the general procedure for retrieving cvs modules here: http://jakarta.apache.org/site/cvsindex.html From there, modify the build.properties.sample file to suit your local sitation (like where a couple of jar files are located) and then use Ant: ant chainsaw Let us know if you have any troubles downloading and/or running it. cheers Paul Smith -Original Message- From: Robert Augustyn [mailto:[EMAIL PROTECTED] Sent: Friday, 28 November 2003 5:24 PM To: 'Log4J Users List' Subject: How stable is Chainsaw 2? Hi, I wonder if Chainsaw 2 is a usable product? If so where can I get it? Thanks. robert __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.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] __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.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: How stable is Chainsaw 2?
Not from what I can see. Only build.properties is loaded. build.properties.sample is ignored and is only used as a template. Jake, you are correct. I must be thinking of another project. Robert, we'll definately need to see the output of the ant target as it runs. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I am not getting stack trace from logger.error(error,e)?
On Fri, 2003-11-28 at 10:45, Robert Augustyn wrote: Hi Ceki, I am getting just one line like: Java.NullPointerException: This maybe only a very slight possibility, but I have seen exactly what you are describing in our production environment when we are using the -server option under the Sun 1.4.2 JDK under Linux (no JBoss though). Just a single line with no more information. See this bug: http://developer.java.sun.com/developer/bugParade/bugs/4761344.html They say it is fixed in 1.4.2, and while it does not happen with the frequency it used to, it's one to look out for. Not using the -server option seems to help, although you lose some performance there. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to configure log4j to generate XMLLayout compatible output.
On Fri, 2003-11-28 at 11:42, Robert Augustyn wrote: Hi, I am playing around with chainsaw and it does not look like it recognizes my log file. I understand that chainsaw expects XMLLayout compatible output file for it to be able to parse it. How do you do that? Thanks a lot. Robert Btw: I am using version which comes with ver 1.2.8 of log4j. Hi Robert, Do you have an appender configured that outputs using the XMLLayout layout class? That's the first step. If so, is Chainsaw throwing an error? We'll need a few more details to help you. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4j configuration.
Please add another system property switch: -Dlog4j.debug=true e.g. java -Dlog4j.configuration=file://c:/jarfiles/log4j.properties org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf and cut/paste what is displayed to standard out into an email to this list so that we can see what is happening.. cheers, Paul Smith You keep insisting on using non-url syntax for your setup even when you reference the correct URL syntax. Do this... java -Dlog4j.configuration=file:/c:/jarfiles/log4j.properties org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf Also, why are you saying... c:\\jarfiles\log4j.properties You are escaping the first \, but not the second one in the path. Shouldn't it be?... c:\\jarfiles\\log4j.properties Anyway, you have to use the URL syntax above for things to work. BTW, I've also seen the URL file syntax on Windows be... file:///c:/jarfiles/log4j.properties Use whichever one works for you. Jake At 05:01 PM 11/27/2003 +0800, you wrote: Hi, I put my log4j.properties file in c:\\jarfiles and I did the following: java -Dlog4j.configuration=c:\\jarfiles\log4j.properties org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf But I get the following: log4j:WARN No appenders could be found for logger (org.pdfbox.pdfparser.PDFParser). log4j:WARN Please initialize the log4j system properly. I read the manual at http://jakarta.apache.org/log4j/docs/manual.html It says the following needs to be done for Tomcat 4: For example: set CATALINA_OPTS=-Dlog4j.configuration=file:/c:/jarfiles/log4j.properties In the environment variables. And I did just that. Can I do the following? java -Dlog4j.configuration=c:\\jarfiles\log4j.properties org.pdfbox.searchengine.lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf I can choose the ignore the error message but I would like to solve this problem before moving on. Anyone can help? - 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: How to configure log4j to generate XMLLayout compatible output.
No I have no appender configured using XMLLayout. Where can I find an example? I have looked through the distribution and could find nothing. Chainsaw does not throw an error it says 0 loaded events when opening the file. Thanks a lot. robert It's pretty easy, here's a snippet from a log4j.properties file: log4j.rootLogger=DEBUG, A1 log4j.appender.A1=org.apache.log4j.FileAppender log4j.appender.A1.layout=org.apache.log4j.xml.XMLLayout log4j.appender.A1.append=true log4j.appender.A1.file=/somepathonyoursystem/log.xml You may want to browse the Wiki: http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/FrequentlyAskedQuestions In case configuring Log4j via property files is new, you may find this URL useful: http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html#doConfigure(java.lang.String, org.apache.log4j.spi.LoggerRepository) cheers, Paul Smith On Fri, 2003-11-28 at 12:25, Robert Augustyn wrote: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4j configuration.
On Fri, 2003-11-28 at 12:36, Tun Lin wrote: Hi Paul, Thanks for your help and quick response but I still get the same error message although there are some additional statements printed out after running the following command as instructed by the last email. This is good, it helps to see that Log4j has found the file ok. Command typed: java -Dlog4j.configuration=file:///c:/jarfiles/log4j.properties -Dlog4j.debug=true org.pdfbox.searchengine. lucene.LucenePDFDocument C:\\pdf\h6603lab4.pdf Error message: log4j: Using URL [file:/c:/jarfiles/log4j.properties] for automatic log4j config uration. log4j: Reading configuration from URL file:/c:/jarfiles/log4j.properties log4j: Parsing for [root] with value=[stdout]. log4j: Level token is [stdout]. log4j: Category root set to DEBUG log4j: Finished configuring. log4j:WARN No appenders could be found for logger (org.pdfbox.pdfparser.PDFParse r). log4j:WARN Please initialize the log4j system properly. Next, please paste the entire contents of the c:/jarfiles/log4j.properties file into another email to the list. It looks like that is the culprit. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: TelnetAppender generates NullPointerException
log4j.appender.telnet.port=23 I think that might need to be: log4j.appender.telnet.Port=23 As the java bean property introspection rules are case sensitive, (it looks for a setPort method) cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log4J Question
On Thu, 2003-11-20 at 22:51, Jones, Marty B. wrote: I was wondering if Log4J will allow me to do the following: configure a RollingFileAppender that logs standard output. configure a RollingFileAppender that logs info and warning output. configure a RollingFileAppender that logs error level output. have a single logger that will use one of the above appenders based upon the logging level of the log method called within a given class. Yes, you can do this. * You will need to use the XML configuration file, as this supports appender filters. * Define each of the appenders in the xml file, and create a filter section for each resepective appender based on the level. * attach all the appenders to your single logger. The wiki has a good example on this: http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/LogByLevel cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chainsaw - viewing log files from client side
On Fri, 2003-11-21 at 05:16, Daniel J Mauer wrote: Thanks. I have Chainsaw v1. If you let me know how to access the V2 software I can give it a try. If the new version includes code for loading a remote XML file via a standard URL and a static factory method to start Chainsaw I think that might be beneficial. Hi Daniel, I have made some changes to Chainsaw to provide the features you requested. From the File menu, the is now a load a remote URL menu item. (might be a little rough around the edges, haven't done heaps of testing) You can also use the org.apache.log4j.chainsaw.LogUI method: public static void createChainsawGUI(boolean showSplash, Action shutdownAction) The Action to pass in is called if the user initiates the exit action, passing null will cause Chainsaw to use the default which is to quit the vm. You can access this from the Apache Cvs (See http://jakarta.apache.org/site/cvsindex.html for more info). Download the jakarta-log4j CVS module, and use ant to run the 'jar' target. Then you can use the generated jars, log4j-1.3alpha.jar and log4j-chainsaw-1.3alpha.jar in the classpath of your app. I would really appreciate it if you did try this out to let us know how you go, and if you have any issues, we'll try to help out as much as possible. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chainsaw - viewing log files from client side
First question, are we talking about Chainsaw v1 (part of the log4j 1.2.8 distribution), or Chainsaw v2, which accessible from CVS, but not officially released as yet. On Thu, 2003-11-20 at 02:31, Daniel J Mauer wrote: Hi, I am looking for a way to view log files stored on the server from a client machine, and am wondering if Chainsaw can be used for this purpose. I know Chainsaw uses a JFileChooser to load files, which I believe cannot be used to access files on a remote server? If it can, how would one restrict access to just the directory where the log files are stored? Finally, does anyone know how to start Chainsaw from code rather than from a script? I would like for it to be possible for our users to start Chainsaw from our application whenever they want to look at log files. Thanks! If you are willing to try things direct from CVS, we might be able to help. v1 of Chainsaw is not being actively maintained, but v2 is currently in heavy, if sporadic, development. Loading a remote XML file via a standard URL has not made it into the v2 version as yet. It really should be simple to do, so maybe I should get off my but and do it Starting from within a running VM would be a little difficult at the moment, I think I could add a static factory method to create one for you. Would that help? cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I use filters in AND condition fashion?
On Thu, 2003-11-20 at 05:16, Scott Deboy wrote: I'm not sure about whether this capability is available using the latest distribution's set of filters, but I've contributed a simple expression language and an ExpressionFilter (should be a part of the next release) which provide support for expressions using a number of operators, grouping (parens), AND, OR and NOT operators, etc.. You will be able to define an expression like: ( LEVEL == INFO ) ( MSG == TEST ) Hey Scott, is this in CVS yet? I can't seem to locate it. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How do I use filters in AND condition fashion?
On Thu, 2003-11-20 at 09:17, Scott Deboy wrote: Yes...currently in the varia package, although I understand Mark may be planning a move to a new package for the filters. Bizarre, I was doing a search from within Eclipse, and I could not find it in the source, I must be going loopy. By the way, since the expressionfilter relies on the rules we've been working on, the rules should probably move out from under the chainsaw package. Yes, a good candidate for their own package under org.apache.log4j thanks. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question on setting different levels
On Thu, 2003-11-13 at 03:45, Scott Smith wrote: OK, you are forcing me to admit my sins. This morning I woke up and guessed the problem (I knew I should have waited another day before asking for help). I think that there must be a universal Law somewhere about this, I've also found numerous times, the answer to something staring me in the face seconds after sending an email Glad it's all sorted! cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Configuration error
On Thu, 2003-11-13 at 02:22, Dimitri Pissarenko wrote: Hello! I'm getting the log4j error message error-message log4j:WARN No appenders could be found for logger (SomeClass). log4j:WARN Please initialize the log4j system properly. /error-message Most likely candidate is that some where in the Test case code/thread of execution, that is re-initialising Log4j after your explicit init call, but before the call to the Logger in question. cheers, Paul This happens in a test case, which has the following main function: code-snippet import junit.framework.TestSuite; public class SomeTestSuite extends TestSuite { ... public static void main(String[] args) { ConsoleAppender consoleAppender=null; consoleAppender=new ConsoleAppender(); BasicConfigurator.configure(); Logger.getRootLogger().addAppender(consoleAppender); Logger.getLogger(SomeClass.class).addAppender(consoleAppender); junit.swingui.TestRunner.run(SomeTestSuite.class); } ... } /code-snippet Why does this error occur despite that fact that I explicitly add an appender to the Logger of SomeClass? How can solve this problem? TIA Dimitri Pissarenko PS: I'm using log4j 1.2.8 - 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: Configuration error
I was also thinking that you might consider putting a Log message immediately following the BasicConfigurator.configure() call. If you receive this message to the console, then something else is re-initing Log4j. BTW, 2 things about your code: * The BasicConfigurator will automatically add and configure a Console appender, should be no need to add one yourself. * Appenders have an activateOptions() method that should be called after all setters properties have been set, if you create an appender manually. cheers, Paul public class SomeTestSuite extends TestSuite { ... public static void main(String[] args) { ConsoleAppender consoleAppender=null; consoleAppender=new ConsoleAppender(); BasicConfigurator.configure(); Logger.getRootLogger().addAppender(consoleAppender); Logger.getLogger(SomeClass.class).addAppender(consoleAppender); junit.swingui.TestRunner.run(SomeTestSuite.class); } ... } /code-snippet Why does this error occur despite that fact that I explicitly add an appender to the Logger of SomeClass? How can solve this problem? TIA Dimitri Pissarenko PS: I'm using log4j 1.2.8 - 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: I cannot figure out where my extra message line comes from on the console
The BasicConfigurator already creates and configures a ConsoleAppender automatically, so the other one that you are adding is doubling up. (The output with the time is your appender is your one I think). cheers, Paul On Thu, 2003-11-13 at 09:40, Chang, Betty wrote: Hi all-- (I'm a new user, so please forgive). Here's my simple program: -- import org.apache.log4j.*; public class MyApp { static Logger logger = Logger.getLogger(myapp); public static void main (String[] args) { PatternLayout pl = new PatternLayout(%-5p %d %m%n); ConsoleAppender cappnd = new ConsoleAppender(pl); BasicConfigurator.configure(cappnd); logger.info(here); } } And here's my output : - here INFO 2003-11-12 14:38:53,530 here I cannot figure where the extra line with - here on my console comes from. I must be doing something silly. Thanks Betty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I cannot figure out where my extra message line comes from on the console
On Thu, 2003-11-13 at 10:00, [EMAIL PROTECTED] wrote: Paul - Are you sure about that? I thought that only happened with BasicConfigurator.configure() (no params). /** Add codeappender/code to the root category. @param appender The appender to add to the root category. */ static public void configure(Appender appender) { Logger root = Logger.getRootLogger(); root.addAppender(appender); } Maybe she is picking up a log4j config file from the classpath? Ken, you're 100% correct, I miss-read her code. Betty, I would suggest commenting out all the lines except the logger.info. What you should see is a warning about no appenders being found, but if you get output, then something else is configuring Log4j. If this is the case, try adding -Dlog4j.debug=true to the command line as you run your code, this should output info on what config file it is picking up. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I cannot figure out where my extra message line comes from on the console
log4j.properties or log4j.xml, somewhere in the classpath. Paul On Thu, 2003-11-13 at 10:10, Chang, Betty wrote: Hi -- If I'm picking up some kind of default config file, what would it be called? Thanks Betty -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 3:01 PM To: [EMAIL PROTECTED] Subject: RE: I cannot figure out where my extra message line comes from on the console Paul - Are you sure about that? I thought that only happened with BasicConfigurator.configure() (no params). /** Add codeappender/code to the root category. @param appender The appender to add to the root category. */ static public void configure(Appender appender) { Logger root = Logger.getRootLogger(); root.addAppender(appender); } Maybe she is picking up a log4j config file from the classpath? Ken -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 5:54 PM To: Log4J Users List Subject: Re: I cannot figure out where my extra message line comes from on the console The BasicConfigurator already creates and configures a ConsoleAppender automatically, so the other one that you are adding is doubling up. (The output with the time is your appender is your one I think). cheers, Paul On Thu, 2003-11-13 at 09:40, Chang, Betty wrote: Hi all-- (I'm a new user, so please forgive). Here's my simple program: -- import org.apache.log4j.*; public class MyApp { static Logger logger = Logger.getLogger(myapp); public static void main (String[] args) { PatternLayout pl = new PatternLayout(%-5p %d %m%n); ConsoleAppender cappnd = new ConsoleAppender(pl); BasicConfigurator.configure(cappnd); logger.info(here); } } And here's my output : - here INFO 2003-11-12 14:38:53,530 here I cannot figure where the extra line with - here on my console comes from. I must be doing something silly. Thanks Betty - 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]
RE: I cannot figure out where my extra message line comes from onthe console
Okay -- so my next question is -- what's the easiest way to get my program to ignore that log4j.properties file? (I don't really want to use my own file -- I just want to configure it in the code). I think the following System property would do it: -Dlog4j.defaultInitOverride=true This will suppress the auto-log4j init. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question on setting different levels
On Wed, 2003-11-12 at 13:57, [EMAIL PROTECTED] wrote: Scott, Is it possible that the Jakarta libraries are reconfiguring log4j on you after your configuration has run? I ran into this with the open source Joram JMS implemnetation. As soon as I started using the Joram classes, some static Joram code would reconfigure log4j and blow away my whole configuration. Can you try running configure after calling some library methods? Mark, good thinking, I'd put some money down that something like that is happening, a similar thing happened to me. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Log4j for Custom logging *NEWBIE*
On Thu, 2003-10-09 at 18:21, Kunal H. Parikh wrote: Hi All ! I have been looking at Log4j and after some reading I believe that Log4j is mainly used for debugging or error logging or info logging. I have a scenario where I may need to log every search conducted on our website. Absolutely, Log4j would work beautifully in this regard. You can take advantage of the log4j framework to log the details in all sorts of ways. cheers, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SMTP Appender Threshold
By default, the SMTPAppender _waits_ for an ERROR level logging event to arrive, and sends with it the BufferSize # of previous events before it inside the email for use in context. Think of the Buffer as a sliding window of events that gets triggered by the arrival of Error. There are some configuration parameters to set which allow you to determine exactly what is the appropriate trigger, an ERROR level event is just the default. Consult the JavaDocs on the SMTPAppender for more information, or Ceki's book The Complete Log4j Manual is an excellent source for this. cheers, Paul On Fri, 2003-10-10 at 01:17, Ken Hoying wrote: Ok. I seem to have the SMTP Appender working now but it seems to be ignoring my Threshold property setting. I want to test by sending DEBUG messages to teh SMTP appender. However, it seems to be ignoring these. Is this a bug? Thanks, Ken __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.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: MemoryAppender
This is exactly what the SMTPAppender does, uses a sliding window (BufferSize property) to hold the events until a triggering event occurs (by default an ERROR level event). cheers, Paul Smith On Fri, 2003-10-10 at 04:07, [EMAIL PROTECTED] wrote: Most of our production applications have log threshold set to INFO most of the time. Request data and response is not logged at INFO level. But to trouble-shoot an ERROR, the support folks like to have detailed information about the request that saw the error. It is not always possible to recreate that error, and there is not much benefit of chaging the log level later. I am sure this is a familiar issue. One solution to the above problem is to use an MemoryAppender for DEBUG level and capture the data required for troubleshooting for each request in a Collection that stores this info for, say last 50 requests, and dumps this to another appender on a predefined event. The predefined event could be a FATAL error or a user initiated event. Is there a similar Appender available in the distribution or the sandbox ? Thanks Shuchi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SMTP Appender Threshold
Check out the JavaDocs for the setEvaluatorClass(String) method on SMTPAppender, and see the JavaDocs for the TriggeringEventEvaluator interface. By setting the Threshold of the SMTPAppender, you are defining what events are candidates to go into the buffer, rather than what triggers the sending of the email. cheers, Paul Smith On Fri, 2003-10-10 at 07:50, Ken Hoying wrote: Looking at the documentation, it would appear that setting the Threshold parameter to DEBUG should accomplish what I want. However, this does not appear to be working as documented. I think this is a bug. Thanks, Ken --- Paul Smith [EMAIL PROTECTED] wrote: By default, the SMTPAppender _waits_ for an ERROR level logging event to arrive, and sends with it the BufferSize # of previous events before it inside the email for use in context. Think of the Buffer as a sliding window of events that gets triggered by the arrival of Error. There are some configuration parameters to set which allow you to determine exactly what is the appropriate trigger, an ERROR level event is just the default. Consult the JavaDocs on the SMTPAppender for more information, or Ceki's book The Complete Log4j Manual is an excellent source for this. cheers, Paul On Fri, 2003-10-10 at 01:17, Ken Hoying wrote: Ok. I seem to have the SMTP Appender working now but it seems to be ignoring my Threshold property setting. I want to test by sending DEBUG messages to teh SMTP appender. However, it seems to be ignoring these. Is this a bug? Thanks, Ken __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.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] __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.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: controlling log directory
On Fri, 2003-10-10 at 10:03, Henrik Vendelbo wrote: How do you configure log directory. I would prefer setting it independent of the file name. Can I define it in log4j.properties, or by modifying properties runtime ? I currently use absolute paths just with forward / under NT, but apparently it isnt working. Hi Henrik, We have this line at the top of our log4j.properties file: webappRoot=/var/tomcat4/webapps/ then in our appender config: log4j.appender.taipanAppender.file=${webappRoot}Taipan/logs/taipan-log4j.log This allows a little more flexibility in defining a base directory etc. For windows, you will probably need something like: webappRoot=c:\\toolkit\\tomcat4.0\\webapps\\ Mainly because of \ need to be escaped. Hope this helps you. regards, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chaining
This is where the NDC would be useful. In Class 2: NDC.push(Class 2); In Class 1: NDC.push(Class 1); Then when you are ready to log a message: log.debug(Message); The NDC entries will be available via the LoggingEvent that is send to the appender, so if you configure an appender to actually output the contents of the NDC, you'll be able to see it. (see things like PatternLayout on how to explicitly request NDC to be output in the appender). NDC acts as a Stack for each Thread of execution, so it retains the order of push/pop. Don't forget to NDC.pop() at the end of each method where you NDC.push(...).. cheers, Paul Smith On Thu, 2003-10-02 at 01:10, David Liles wrote: I just started using log4j and am having trouble trying to figure out how to chain logging messages class 1 makes a call to class 2 I would like to be able to pass the message from class 2 to class 1 where it would ultimately be logged, that way when I review the log file it would show that the message originated in class 2, but would be displayed something like this: class2 - class1 - message. Hope I'm making sense Thanks - Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SMTPAppender and BufferSize.
On Sun, 2003-09-28 at 04:03, [EMAIL PROTECTED] wrote: Greetings: I have what I hope to be a simple question. We are using the log4j implementation in JBoss 3.0.4. When I activate the SMTP Appender for ERROR level to send me an email for any exceptions and stack traces, I was under the impression that I could buffer events and have the email contain more than one log entry in the email body. I get an email for every single log entry. Am I way off base? There are 2 important properties for SMTPAppender, the EvaluatorClass, and the Threshold. You have set the Threshold to Error, and the appender is using the default EvaluatorClass which matches ERROR. Basically it's the EvaluatorClass property that determines WHEN to send the email, and uses the Buffer of events received since the last Triggering event. Since you have the threshold set to ERROR, the appender is only letting that 1 event get in the Buffer. Try setting the Threshold to INFO, and you should find the email you receive should contain the last X INFO-and-above events plus the ERROR event that triggered it. I have simply started using the commented config in the log4j.xml supplied by Jboss. appender name=SMTP class=org.apache.log4j.net.SMTPAppender param name=Threshold value=ERROR/ param name=To value=[EMAIL PROTECTED]/ param name=From value=[EMAIL PROTECTED]/ param name=Subject value=JBoss Sever Exception/ param name=SMTPHost value=xxx.xxx.x.xx/ param name=BufferSize value=10/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=[%d{ABSOLUTE},%c{1}] %m%n/ /layout /appender If the Error message itself contains everything you need to know, then this is fine, but at any rate I think the BufferSize is misleading here. Perhaps an issue to address with the JBoss team? cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Plans for supporting a build in level of trace
On Thu, 2003-09-25 at 01:03, Larry Young wrote: Paul, Actually, based on our conversation back in August, it works out better if you put the trace at the front of the class name, that way you still can specify package names and get everything underneath it, and you can also turn on tracing without a package or class name. For example, 'trace.com.acme.utils' would turn on tracing for all classes under the utils package. That's a bit harder to do with 'trace' at the end. Thanks for refreshing my memory Larry, as I was writing it I tried to remember our conversation, and got myself muddled. Must be lack of coffee. I am excited by the new Domain concept that Ceki is developing, sounds like it will solve a large number of logging issues. Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Plans for supporting a build in level of trace
IMHO, the simplicity of Debug/info/warn/error/fatal is one of Log4j's strengths. I personally would not want Trace However, if I required Trace-style logging, I would simply log to a dotted logger name ---.trace. E.g If I have a component com.mycompany.mycomponent, I have a complimentary com.mycomany.mycomponent.trace logger, and configure Log4j to suppress this logger under normal circumstances. The other advantage to this approach is that you can get all Trace style logs into their own appender very easily (attach the appropriate appender to each .trace logger in the config), which means my trace logs are separated easily from the other debug, which I think is what a lot of people are worried about. I can't see anyone wanting to wade through Trace AND Debug log messages to find things out, but maybe I can't see the use case that other people have. Having said all this, as a Log4j developer I wonder since we've previously made a lot of effort to match JDK 1.4's syntax (e.g. Category-Logger, Priority-Level), one might argue that it's not too much effort to go that extra mile to just add the Trace level for those that way inclined. Perhaps those log4j dev-people who were involved in the Log4j-JDK1.4 matching development might be able to comment on any rationale etc. But for me, I'm very happy with the current Trace-less log4j. Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Elementary question
Could you not place the configuration file in the root of the /WEB-INF/classes/ ? Log4j will automatically find log4j.xml or log4j.properties if it is located there. Alternatively you could use the Thread.currentThread.getContextClassLoader(), this should work well inside a Webapp. cheers, Paul Smith On Mon, 2003-09-08 at 12:23, Bhamidi Krishna wrote: Hi, I am trying to configure log4j for an app. Currently, I have deployed it on Tomcat. My code snippet is - .. String configFileName = com.common.logger.xml; URL url = null; Context ctx=null; ctx = new InitialContext(); url = ctx.getClass().getResource(configFileName); . I put the xml file under a directory structure under classes in my web-app. The issue is that the URL is null. I also tried other options like making the string \com\common\logger.xml and com\common\logger.xml Another approach I tried was to get Thread.currentThread.getClassLoader and read the URL from there, I get a vague null pointer exception and zip exception. I am sorry if this is a very elementary question, but I could not find any solutions in the lists also. Krishna. - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LogFactor5 and SocketHubAppender functionality
If you don't want to wait for the official release, the HEAD version of Chainsaw v2 supports it via defining it in a log4j configuration file, and we're - - close to tidying up the UI to specify it via the GUI too. cheers, Paul Smith On Tue, 2003-09-09 at 05:22, Lance Birtcil wrote: Hi, Has anyone been successful in getting a SocketHubAppender type solution to work with LogFactor5 in the 1.2.8 release? I'm looking to be able to specify a port on my server that multiple LogFactor5 clients can connect to to receive logging events. From what I can tell, LF5 only works with SocketAppenders -- a pity since I have to create a separate SocketAppender for each machine on which I want to be able to view logging events. In reading posts in the mail archive, it seems that the new Receiver framework should allow the type of behavior that I'm looking for in LF5. However, I'm hoping that I don't have to wait for 1.3.x to get this working. How about it? Anyone gotten this to work in 1.2.8? Thanks, --LB - 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: LevelRangeFilter not working
Hi Matt, I think you might have 2 filters confused. LevelRangeFilter needs a range of Levels to accept/deny. In your case you have said that the Maximum is Error, but have no Minimum set and therefore only logs with levels greater than error will get denied. You are probably wanting the LevelMatchFilter which takes a single level to match, and only accepts those, denies all others. Otherwise you could set the LevelMin of the LevelRangeFilter to ERROR and that should work too, I think. cheers, Paul Smith On Sat, 2003-09-06 at 07:55, Matt Raible wrote: I two appenders - a console and a file. I want all messages to go to the console and only = error to go to the file. In my file appender, I have a filter to only get the error messages: filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter Then in root I have: root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=FILE/ /root From the documentation I've read (i.e. http://tinyurl.com/meef), this *should* work. However, all messages get logged to both the console appender and the file appender. Help is appreciated. Matt My full log4j.xml file: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; appender name=CONSOLE class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%p - %C{1}.%M(%L) | %m%n/ /layout /appender appender name=ERROR_LOG class=org.apache.log4j.RollingFileAppender param name=File value=${catalina.home}[EMAIL PROTECTED]@/error.log/ param name=Append value=false/ param name=MaxFileSize value=333KB/ param name=MaxBackupIndex value=3/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d [%t] %-5p %c{2} - %m%n/ /layout filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter /appender logger name=org.apache level value=WARN/ appender-ref ref=CONSOLE/ /logger root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=ERROR_LOG/ /root /log4j:configuration - 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: LevelRangeFilter not working
Sorry, I got confused when you said =Error in your original post, was that a typo, did you mean =Error? Ok, to confirm, you only want ERROR and FATAL to go to your file appender, and allow all errors to go to the console? cheers, Paul On Mon, 2003-09-08 at 08:12, Matt Raible wrote: I believe I have it configured correctly. I want to log messages that are FATAL or ERROR - nothing above error. Matt -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, September 07, 2003 4:05 PM To: Log4J Users List Subject: Re: LevelRangeFilter not working Hi Matt, I think you might have 2 filters confused. LevelRangeFilter needs a range of Levels to accept/deny. In your case you have said that the Maximum is Error, but have no Minimum set and therefore only logs with levels greater than error will get denied. You are probably wanting the LevelMatchFilter which takes a single level to match, and only accepts those, denies all others. Otherwise you could set the LevelMin of the LevelRangeFilter to ERROR and that should work too, I think. cheers, Paul Smith On Sat, 2003-09-06 at 07:55, Matt Raible wrote: I two appenders - a console and a file. I want all messages to go to the console and only = error to go to the file. In my file appender, I have a filter to only get the error messages: filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter Then in root I have: root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=FILE/ /root From the documentation I've read (i.e. http://tinyurl.com/meef), this *should* work. However, all messages get logged to both the console appender and the file appender. Help is appreciated. Matt My full log4j.xml file: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; appender name=CONSOLE class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%p - %C{1}.%M(%L) | %m%n/ /layout /appender appender name=ERROR_LOG class=org.apache.log4j.RollingFileAppender param name=File value=${catalina.home}[EMAIL PROTECTED]@/error.log/ param name=Append value=false/ param name=MaxFileSize value=333KB/ param name=MaxBackupIndex value=3/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d [%t] %-5p %c{2} - %m%n/ /layout filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter /appender logger name=org.apache level value=WARN/ appender-ref ref=CONSOLE/ /logger root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=ERROR_LOG/ /root /log4j:configuration - 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]
RE: LevelRangeFilter not working
Ok, if that is the case, then you definately want a LevelRangeFilter, and you want to set the MinLevel to ERROR, and the MaxLevel to FATAL (or don't have a Max). Here is the source code the relevant method inside LevelRangeFilter, you can see how it works: public int decide(LoggingEvent event) { if(this.levelMin != null) { if (event.getLevel().isGreaterOrEqual(levelMin) == false) { // level of event is less than minimum return Filter.DENY; } } if(this.levelMax != null) { if (event.getLevel().toInt() levelMax.toInt()) { // level of event is greater than maximum // Alas, there is no Level.isGreater method. and using // a combo of isGreaterOrEqual !Equal seems worse than // checking the int values of the level objects.. return Filter.DENY; } } if (acceptOnMatch) { // this filter set up to bypass later filters and always return // accept if level in range return Filter.ACCEPT; } else { // event is ok for this filter; allow later filters to have a look.. return Filter.NEUTRAL; } } Hope this helps, Paul On Mon, 2003-09-08 at 08:45, Matt Raible wrote: Yep - I only want ERROR and FATAL to go to my file appender and all messages (fatal - debug) to go to the console. -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, September 07, 2003 4:18 PM To: Log4J Users List Subject: RE: LevelRangeFilter not working Sorry, I got confused when you said =Error in your original post, was that a typo, did you mean =Error? Ok, to confirm, you only want ERROR and FATAL to go to your file appender, and allow all errors to go to the console? cheers, Paul On Mon, 2003-09-08 at 08:12, Matt Raible wrote: I believe I have it configured correctly. I want to log messages that are FATAL or ERROR - nothing above error. Matt -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Sunday, September 07, 2003 4:05 PM To: Log4J Users List Subject: Re: LevelRangeFilter not working Hi Matt, I think you might have 2 filters confused. LevelRangeFilter needs a range of Levels to accept/deny. In your case you have said that the Maximum is Error, but have no Minimum set and therefore only logs with levels greater than error will get denied. You are probably wanting the LevelMatchFilter which takes a single level to match, and only accepts those, denies all others. Otherwise you could set the LevelMin of the LevelRangeFilter to ERROR and that should work too, I think. cheers, Paul Smith On Sat, 2003-09-06 at 07:55, Matt Raible wrote: I two appenders - a console and a file. I want all messages to go to the console and only = error to go to the file. In my file appender, I have a filter to only get the error messages: filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter Then in root I have: root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=FILE/ /root From the documentation I've read (i.e. http://tinyurl.com/meef), this *should* work. However, all messages get logged to both the console appender and the file appender. Help is appreciated. Matt My full log4j.xml file: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE log4j:configuration SYSTEM log4j.dtd log4j:configuration xmlns:log4j=http://jakarta.apache.org/log4j/; appender name=CONSOLE class=org.apache.log4j.ConsoleAppender layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%p - %C{1}.%M(%L) | %m%n/ /layout /appender appender name=ERROR_LOG class=org.apache.log4j.RollingFileAppender param name=File value=${catalina.home}[EMAIL PROTECTED]@/error.log/ param name=Append value=false/ param name=MaxFileSize value=333KB/ param name=MaxBackupIndex value=3/ layout class=org.apache.log4j.PatternLayout param name=ConversionPattern value=%d [%t] %-5p %c{2} - %m%n/ /layout filter class=org.apache.log4j.varia.LevelRangeFilter param name=LevelMax value=ERROR / /filter /appender logger name=org.apache level value=WARN/ appender-ref ref=CONSOLE/ /logger root level value=DEBUG/ appender-ref ref=CONSOLE/ appender-ref ref=ERROR_LOG/ /root /log4j:configuration - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED
RE: embedding chainsaw or logfactor5
On Mon, 2003-09-01 at 18:33, Ricardo Trindade wrote: not yet. is it released or CVS only ? No, not released yet, but if you check out the jakarta-log4j module from the apache CVS repository, and use the chainsaw target of the ant build script you can try it out. Chainsaw v2 is targeted for the Log4j 1.3 release (crossing fingers it makes it in time). Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: embedding chainsaw or logfactor5
On Sat, 2003-08-30 at 01:40, Ricardo Trindade wrote: I can speak for Chainsaw, as one of the developers of it, I'll defer to someone else with more LF5 experience to comment on it. Depends what you mean by embed? What did you have in mind? I want to have a JPanel inside my application with the chainsaw interface. Hmmm, unfortunately right now I think that won't be possible. Currently Chainsaw v2 is a little coupled with it's Menu's/status's bars etc. (have you seen the new v2 of Chainsaw?, with all the tabs etc?) It's definately on our TODO list anyway. Paul - 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: duplicate logging?
On Fri, 2003-08-29 at 09:02, Rishikesh Tembe wrote: Hi Paul, Based on the manual and what you said, this is what I did: I am logging events in 2 classes, viz. com.sap.A - with corresp. logger com.sap.A com.sap.B - with corresp. logger com.sap.B In the props file, I write: log4j.additivity.com.sap.A=false log4j.additivity.com.sap.B=false as in each case I want the logging to stop and not go higher up the heirarchy. Is this right? I still get the same result though.. one line all be itself and the other line following the pattern I specify.. That looks right, could you paste your entire log4j.properties file in a reply so I can take a peek? I think it might be now an appender config issue. Could you also discuss with us where you actually want the results of each of those loggers to go, and if you could refresh my memory as to where they are actually going again that will help me a lot. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: duplicate logging?
On Fri, 2003-08-29 at 09:23, Rishikesh Tembe wrote: -log4j.properties- log4j.rootLogger=INFO, d1 log4j.additivity.com.sap.EventThread=false log4j.appender.d1=org.apache.log4j.FileAppender log4j.appender.d1.File=threads.log log4j.appender.d1.layout=org.apache.log4j.PatternLayout log4j.appender.d1.layout.ConversionPattern=%d [%t] : %m%n -- Within com.sap.EventThread, I have foll. code snippets: { logger = Logger.getLogger(com.sap.EventThread); PatternLayout pattern = new PatternLayout(); FileAppender appender = null; try { appender = new FileAppender(pattern, threads.log, true); } catch(Exception e) { e.printStackTrace(); }; logger.addAppender(appender); logger.setLevel((Level)Level.INFO); Thanks for this, it helps a lot. What you appear to be doing, if I make it out correctly, is creating a SECOND appender using Java code that is a complete duplicate (apart from the pattern). Is there any need? Is the appender specified in the configuration file ok to use? What I would recommend is: a) remove the Java code dealing with configuring appenders, I just can't see a good reason for it there (hard coding appenders is a maintainence nightmare). Leave it to the configuration file. b) the code logger = Logger.getLogger(com.sap.EventThread), make sure this is only called once! Best practice is to make the logger variable a private static final. the Logger.getLogger call is not exactly cheap, just get a reference as early as possible, and use it everywhere in your class. It's thread-safe, don't worry. c) You define the appenders in the configuration file, and you identify which Loggers the appenders get attached to. You will notice your config file: log4j.rootLogger=INFO, d1 This attaches the named appender 'd1' to the Root logger. I'd recommend removing this so it is just: log4j.rootLogger=INFO Now attach your d1 logger to your com.sap.EventThread logger like so: log4j.logger.com.sap.EventThread=INFO,d1 This should work a treat. Let me know how you go. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: duplicate logging?
It did work a treat! thanks... That gave me better insight into log4j. Basically, we can - configure it programatically through the API - OR use the props file Right? Yes, although the property/xml files are the way to go. Just Log stuff in your Java code, and don't worry about where it's going. Then, later on, you can put on your Where should my log statements go hat and deal with what should be appended where/when in the configuration file. This separation makes Logging nice and clean. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding chainsaw or logfactor5
Hi Ricardo, On Thu, 2003-08-28 at 19:58, Ricardo Trindade wrote: Hi, I'm using logfactor5, and I'm wondering if it's possible to embed the logfactor5 or chainsaw swing panel inside my application. I can speak for Chainsaw, as one of the developers of it, I'll defer to someone else with more LF5 experience to comment on it. Depends what you mean by embed? What did you have in mind? I'm also wondering if it's possible to use SocketHubAppender with chainsaw/lf5 with the 1.2.8 release. To be honest I can't remember what Chainsaw does in the 1.2.8 version! (and I'm one of the Chainsaw developers.) I'm not sure it can, I think it was more of an accepting-connections style, rather than making connections. The latest version in CVS certainly can, it does via the Receiver concept. There is a SocketHubReceiver that can be configured which effectively creates connections to your SocketHubAppender (there should be complimentary Receiver's for each network based Appender in the latest CVS). I'd recommend trying out the latest CVS HEAD version where Chainsaw v2 is currently on the back straight for completion, it's very stable (been using it myself for months). Try checking out the jakarta-log4j module from CVS, and running ant chainsaw (copy the build.properties.sample to suit your needs) cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org/apache/log4j/Category problem
On Wed, 2003-08-27 at 11:48, Rishikesh Tembe wrote: Hi all, I have a servlet running in Tomcat, which I have setup to do logging via log4j. However, I get the foll. error when I try to run my app: java.lang.NoClassDefFoundError: org/apache/log4j/Category I have the jog4j-1.2.8.jar file in my classpath. Yes, it might be in your classpath, but is Tomcat using that classpath? NoClassDefFoundError definately means the CLassloader cannot locate the class via any means. Try dropping the log4j Jar file in your webapps WEB-INF/lib directory. You can also save yourself the effort of property configuration code by putting the log4j.properties file physically in the WEB-INF/classes directory of your webapp, Log4j will then find it auto-magically. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org/apache/log4j/Category problem
On Thu, 2003-08-28 at 03:43, Rishikesh Tembe wrote: Hi Thanks Phil and Jacob for your input. The problem was due to the existence of multiple versions of the jog4j.jar file. After I cleaned everything up, put the jar in WEB-INF/lib and the props file in WEB-INF/classes, everything worked! Has the format of the XML/props file been specfied anywhere? I couldn't find a list of supported properties in the manual... Hi again, All the supported properties for Appenders etc are the public setter methods. e.g. if an Appender has a setFile(..) method, then there is a 'file' property that can be set, so it's usually just a matter of looking at the JavaDoc for the specific item in question. For the other configuration elements I would recommend reading these links: * The Log4J FAQ Wiki - http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/FrequentlyAskedQuestions (The first link is on XML Configuration) * The Property Config Javadoc - http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html ( the first link in the desc, doConfigure(...) contains the juicy bits. Don't forget Ceki's book, https://www.qos.ch/shop/products/clm_t.jsp you'll be kicking goals in no time with this. Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: duplicate logging?
On Thu, 2003-08-28 at 06:32, Rishikesh Tembe wrote: Is this how its done? log4j.rootLogger.additivity=false Close, but no cigar. The Log Event starts getting logged at it's own Logger (say, the com.mycompony.mycomponent Logger, and gets logged up the hierarchy until it reaches the root Logger, so you need to set the addidivity at the Logger point where you wish to stop going up. So if you want the LogEvent to start and stop at it's own logger: log4j.additivity.com.mycompany.mycomponent=false (note that additivity is first) If you wish all com.mycompany and their children Log events to stop logging there log4j.additivity.com.mycompany=false Once it's reached the rootLogger, it can't go any higher, so your setting has no effect. The short manual has a good discussion on it: http://jakarta.apache.org/log4j/docs/manual.html (see the section on Appender additivity). cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Instant Logging Article
I could really use something like this myself. Could we perhaps ask if the author might be in a position to be able to donate the source code into the sandbox? cheers, Paul On Thu, 2003-08-14 at 06:14, Ceki Glc wrote: I hadn't seen it before. Really well written and informative article. I have a weak spot for SMTPAppender. (If you are not using it, you should.) I am still not 100% convinced, but this article makes a good case of why IMAppender might be preferable to SMTPAppender under certain circumstances. Thanks for forwarding it. At 09:08 AM 8/13/2003 -0400, you wrote: Howdy, Even though I'm sure many have seen it, I wanted to send a link to this interesting article: http://www-106.ibm.com/developerworks/java/library/j-instlog/ The article has an overview of log4j and details on how to implement a remote instant messages (IM) appender. Yoav Shapira Millennium ChemInformatics - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: discreet log types
On Fri, 2003-08-15 at 07:49, Larry Young wrote: Ceki, That's an interesting way of looking at logger types! But how would that allow me to enable/disable log messages for a particular class? One of the features I need is the ability to specify that a particular class should display a particular type of log message (or possibly more than one). This would appear to only let me set the message type system wide. Did I miss something? No, you haven't missed anything, it would set the types system wide, and allow you to specify the level system wide, but if that was not granular enough, can't you specific a particular Filter for your appender? (i.e all classes logging to the DB logger, but you filter for a particular class). I'm sure you could write yourself a Filter sub-class very quickly and attach it to an Appender via the configuration. You could configure this Filter impl with some configuration as to what classes you want to see output. Hope that makes sense. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: discreet log types
Yes, actually I had already gone down that road as one of my first solutions before I posted my original message. However, when I considered that option, I was appending the logging type, which was a problem when trying to specify packages instead of individual classes. But your suggestion to put it at the beginning could solve that problem. As I was writing my last message I also started with it at the end, and realised the same thing you have. I think it has more power at the front. Log4j does not have a complete taxonomy, it is strictly hierarchical, so you will ALWAYS have to choose a primary node structure at the top (this is usually the package name hierarchy). It sounds like your aspect (DB, TRACE) etc is your primary concern, with a secondary concern of the source class. I'm not so worried about it being clumsy because I can always hide it with a wrapper around the front-end if necessary (i.e. create a static factory-like method). And I would only have to define loggers for the logging types that my class would be using, not necessarily every one that is defined, especially since the list needs to be extensible. And it would also allow me to enable multiple logging types for a single class/package. I'll have to give this one some more thought! It's not the cleanest of solutions, but if no one else on the list thinks this would be a good feature to have, then perhaps this would be the quickest solution for my situation. Thanks again for your ideas! Feel free to discuss your ideas further on the list as you develop them, I'm sure other people will be interested in how you go (definately me). May even be worth a nice Wiki page outlining your ideas, and how you accomplished them. I'm sure other people would appreciate it if you have the time. (see http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages) cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chainsaw 2 filtering wishes...
On Wed, 2003-07-30 at 17:14, Max Rydahl Andersen wrote: 2. Any way to show elapsed time between visible rows - instead of just the event time ? That's probably a performance killer at this stage. We could probably easily allow you to Select two rows, and provide either a status bar and/or popup option to display the time difference, but doing it for every single row is probably something I would prefer not to do at this stage. This should not be a performance killer tabModel.getValueAt(timestampcol, row) - tabModel.getValueAt(timestampcol, row-1) isn't that much of a killer is it (it is constant) ? (it should ofcourse be an option - not something always done) Doing this for every single row would be... Perhaps you didn't mean that, I was under the impression you wanted each row to display a time value which is the elapsed time since the previous row. Or maybe you did mean this. Also from a purest point of view, each row would have to know what row number it was, and be able to find out the previous row which is a bit 'coupley'. It certainly might be possible, but me personally I would just highlight two rows and click an action to tell me the difference. Lazy you ;) http://traxel.com/lumbermill/ Check it out - there hierachy management is better than LF5 IMHO ;) Many thx! Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: discreet log types
Hi Larry, This is where you would probably delve into the MDC/NDC/Properties usage. At each 'type' point/location in code I would add a MDC/NDC/Property (whatever works best) at the point, and remove it afterwards where appropriate. The log events generated between these places would then have a Level, belong to a Logger (you're class/interface/logger name), and have additional information for your 'type'. Then it is just a matter of configuring Filters at the appender level to filter out events that you're not interested in for that appender. You might have to develop some custom Filter classes to meet your needs, or re-use/build on the Filter classes that are in Log4j, but that's the approach I would use. Configuration reloading is free out of the box, just register a File Watchdog (see the PropertyConfigurator.configureAndWatch(file, watchTime) method, plus the DOMConfigurator obviously has this too). I hope this helps you. cheers, Paul Smith On Thu, 2003-07-31 at 09:25, Larry Young wrote: Hello, I'm looking at creating a logging package for our applications (web non-web). The reason for yet-another-logger is that I want discreet logging types, not hierarchical levels. I've built this kind of a package before for previous projects, and ended up building the whole thing because I didn't think log4j could do what I wanted (that was several years ago). Now I'm building another one, and looking at the current version of log4j, and having read much of Ceki's book (which I highly recommend!), I'm thinking that there's got to be a way of re-configuring (bending?) log4j to do what I need. I don't think it's that far off. Basically, I want to be able to enable/disable logging for a particular class or package by type, and each type is totally independent of every other type. Some examples of types might be: Fatal, Error, Timing, CodeBlock, ControlPoint, DBAccess, Info, etc. There is no implicit ordering between these various types, so levels are inappropriate. What I want to be able to do is to turn on/off each type independently, so that I can turn on Timing without having to also turn on Info, or be able to turn on CodeBlock without turning on Error. I also want the users of my package to be able to define additional types and register them with the logger at runtime (via code or xml ???). Oh yeah, I also need to have the logger reload the config file (or some portion of it) on a regular basis so that we can change the enabled types without bouncing the app-server or restarting the application. I was thinking if I tried to tie all my types to a single level, and did something with the log-level filtering to enable/disable by package or class, that would get me close. I'm not sure how I'd tie in the type. I'd probably have to programatically update the log-level filters with updates to handle config changes at runtime. Thoughts, ideas, concerns???Any comments are gratefully accepted! :) --- regards --- Larry -- Larry Young The Dalmatian Group www.dalmatian.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: Chainsaw 2 filtering problems...
I think you want .* don't you? . just means a single character, which is unlikely to be a very useful Logging statement and so probably won't match anything. :) So if you want anything that has an blah in it, I would try (off the top of my head, and 2-1 odds this ends up being wrong) try .*blah.*. Any other Chainsaw 2 feedback very welcome. cheers, Paul Smith (Co-dev-type-guy of Chainsaw2, alas swamped by job at the moment) On Tue, 2003-07-29 at 16:39, Max Rydahl Andersen wrote: Hi! First: I like the new Chainsaw 2 ;) Second: The filtering mechanism should work with regular expression if ORO is installed and if not fallback to case-insensitive indexof filtering, right ? Why is it then that enterin '.' (a dot - whichi should match everything) filters out ALL lines ? And entering 'e' (the letter e, which is part of 99,9% of my messages) instead also filters out ALL lines ? I simply can't make the filtering mechanism work :( Any ideas ? /max - 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: Chainsaw 2 filtering problems...
Just checking all angles, the mistake I always make is making sure the correct filter drop down is selected (ie. I am wanting to filter the message column, but the drop has timestamp selected, which of course finds nothing). Also check what the tooltip is when you mouse over the search string text box, let us know what it says. cheers, Paul Smith On Tue, 2003-07-29 at 17:12, Max Rydahl Andersen wrote: I actually also meant '.*' .- and it ain't make any difference - everything is still just filtered away. .*e.* does the same thing /max Paul Smith wrote: I think you want .* don't you? . just means a single character, which is unlikely to be a very useful Logging statement and so probably won't match anything. :) So if you want anything that has an blah in it, I would try (off the top of my head, and 2-1 odds this ends up being wrong) try .*blah.*. Any other Chainsaw 2 feedback very welcome. cheers, Paul Smith (Co-dev-type-guy of Chainsaw2, alas swamped by job at the moment) On Tue, 2003-07-29 at 16:39, Max Rydahl Andersen wrote: Hi! First: I like the new Chainsaw 2 ;) Second: The filtering mechanism should work with regular expression if ORO is installed and if not fallback to case-insensitive indexof filtering, right ? Why is it then that enterin '.' (a dot - whichi should match everything) filters out ALL lines ? And entering 'e' (the letter e, which is part of 99,9% of my messages) instead also filters out ALL lines ? I simply can't make the filtering mechanism work :( Any ideas ? /max - 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]
Re: Chainsaw 2 filtering wishes...
On Tue, 2003-07-29 at 19:45, Max Rydahl Andersen wrote: Know it works I got some wishes/ideas ;) 1. Let me select wether I want to use regular expression or case insensitive matching (actually, enabling caseinsensitve regular expression would be a nice option) A good idea. 2. Any way to show elapsed time between visible rows - instead of just the event time ? That's probably a performance killer at this stage. We could probably easily allow you to Select two rows, and provide either a status bar and/or popup option to display the time difference, but doing it for every single row is probably something I would prefer not to do at this stage. 3. Let me define a SimpleDateFormat expression for the time stamp rows. Another good idea, we've thought of that one too, we're working towards some ideas for the preferences side of things, so this one will definitely go in. 4. Let me define which part of the Logger name I want to see. e.g. in x.y.z.some.package.LoggerTableView I would like to see LoggerTableView more than I like to see x.y.z..some... (maybe get inspired of eclipse's package name compression scheme Another good one (this also drives me a little crazy). 5. Let me view the logger hiearchy and enable/disable/filter on that (Look at Lumbermill for inspiration - its gui is actually quite good regarding enabling/disabling parents/children levels) Got a link for Lumbermill? (too busy, I mean lazy, to do a google search). cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4j presentation at ApacheCon 2003
Hi Ceki Here is a draft of my log4j presentation abstract for ApacheCon 2003. [snip] This will first quickly introduce log4j and proceed to discuss each of the aforementioned improvements in some detail. Looks good.come see everyone. Will they web cast your talk? I don't want to miss out being down here in Oz. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Log4J admin web app
Hi Jim, We've been doing a lot of JMX stuff for our app at work, and I'm hooked. Let me know what you're thoughts are, as I'd love to be part of the discussion too, as I am keen to be able to manage the Log4j stuff for our app via JMX. cheers, Paul Smith -Original Message- From: Doyle, Jim To: [EMAIL PROTECTED] Sent: 7/19/03 8:37 AM Subject: RE: Log4J admin web app Yoav, Mark, Thanks for the feedback, now I'm on the same page as everyone else. The features provided by the ConfigurationServlet now (listing Loggers and letting you change their priorities) is probably good enough for what our admins need. So I probably won't attempt to enhance it right now, but if I do I will certainly share the patches. :) One thing I would probably contribute right off the bat, though, are deployment descriptors (samples at least) and a revised Ant target that builds a war file for the ConfigurationServlet itself. Right now I'm comparing JMX support with ConfigurationServlet and deciding which way to go. (I'm going to post about JMX in a separate thread.) Thanks again, Jim - 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: DailyRollingFileAppender - why isn't rollOver protected
Thanks. I already told Ceki my opinion about log4j (I think it is really great and I love it). I would gladly check the file in jakarta-log4j and tell you if it solves my problem or any other feedback I have. However, I have to admit that I don't know how to find it. I never browsed the CVS before, the best I could find is: http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/a pache/log4j/Da ilyRollingFileAppender.java but this claimed to be version 1.24 and suffer from all the problems I have in version 1.28. can you help me finding the right file. Hello Avner, Firstly apologise for the lengthy days delay in responding, I have been off work due to the dreaded flu that is hitting everyone here in Australia. Your question gave me an opportunity to explore more Ceki's new rollover area so that I can respond with at least some facts. From what I can tell by browsing the code, the relevant packages in the jakarta-log4j are org.apache.log4j.rolling and it's 'helper' sub-package. http://cvs.apache.org/viewcvs.cgi/jakarta-log4j/src/java/org/apache/log4j/ro lling/ Inside this main package is a brand new RollingFileAppender class, which you can use, and configure it with an implementation of a TriggeringPolicy, and a RollingPolicy. (This is the classic strategy pattern to allow you to plugin different ways of doing things). There will now be no need to sub-class the RollingAppender class, but just provide the RollingAppender with a custom TriggerPolicy or RollingPolicy as is required in your circumstances. A TriggeringPolicy is the 'when' of how the appender should roll, and the RollingPolicy is the 'how' the rolling actually occurs. You will notice that the rolling package has a TimeBasedRollingPolicy, and a SizedBasedTriggerPolicy class, these implement the classic configs of yester-year by Rolling based on time or by size. In your case you could probably choose to wrap one of these existing policies in your own class, first checking if anyone is reading the file, and if it meets at least those requirements, forwarding on the call to the wrapped Policy to do the work. Wrapping is usually my preferred way of doing things, but you may just prefer to sub-class, either works fine. I hope this helps you. regards, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Mail (was RE: Buying the manual from switzerland)
It sometimes takes nearly a week for a small piece of mail (i.e a letter) to get from Sydney to Melbourne (comparable from LA-San Fran). I also had a DHL package tracked via the web that spent more time in Sydney than it did travelling from Amazon in Seattle through to Sydney PLUS the time taken to move from Sydney to my office in Melbourne. What is even more amazing is that tracking a FedEx parcal via the web I saw between 1 minute page refreshes my package status changed from In Transit to Signed for by , 15 seconds before our receptionist rang to say I had a package at the front desk. Paul Smith -Original Message- From: Ceki Gülcü [mailto:[EMAIL PROTECTED] Sent: Friday, 4 July 2003 8:31 AM To: Log4J Users List Subject: Re: Buying the manual from switzerland Scott, Thank you for your vote of confidence. In 99+ percent of cases, the packages we send arrive to destination in a timely fashion. If you stop to think about it, it is a remarkable technological feat by the post offices of the countries involved. We drop a package at our local post office in Lausanne, Switzerland on a Monday morning and the same package resurfaces the next Monday in Tuscaloosa, Alabama or in Tasmania, Australia. It just does, by magic. Pouff!! Although practically none of the packages we sent were lost, some were delayed. In one case that we were able to track down, it took over 3 weeks for the book to arrive to Frankfurt which is just several hours train ride from Lausanne. It appears that the book arrived to Frankfurt by *airplane* but was delayed by the German customs for two weeks. They charged the customer custom duty of about 1 Euro and 50 cents (approx. 1.75 USD). Meanwhile, the customer was irate with us because we failed to deliver on time. This actually happened several times with packets sent to Germany. At 05:07 PM 7/3/2003 -0400, you wrote: I received my copy in about a week. I have waited longer from some us vendors actually... The service was quite prompt. And the book is very useful and well written. Two thumbs up Scott -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - 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: tomcat and log4j, again
Mmmm, for some reason it is using all the right class loaders to attempt to find the log4j.xml file, but it only uses 1 different methods to try to find log4j.properties. That is odd. Is this a Tomcat 4.1 specific class loader issue? What about trying converting your log4j.properties file into a log4j.xml file, and placing it in the same spot. Given the catalina.out is attempting to look for that file in the right spots it should find it. Paul -Original Message- From: Dean A. Hoover [mailto:[EMAIL PROTECTED] Sent: Friday, 4 July 2003 8:37 AM To: Log4J Users List Subject: Re: tomcat and log4j, again Ceki Gülcü wrote: My suggestion would be to start tomcat and set the log4j.debug property to true. OK, did it: log4j.debug=true log4j.logger.fermataintl.migrasponder=DEBUG, l1 log4j.appender.l1=org.apache.log4j.FileAppender log4j.appender.l1.File=/tmp/migrasponder log4j.appender.l1.layout=org.apache.log4j.PatternLayout log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} %-5p %F:%L - %m%n The extra command line argument is -Dlog4j.debug=true Did that too: [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# CATALINA_OPTS=-Dlog4j.debug=true [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# export CATALINA_OPTS [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# rm logs/catalina.out rm: remove regular file `logs/catalina.out'? y [EMAIL PROTECTED] jakarta-tomcat-4.1.24]# bin/startup.sh Using CATALINA_BASE: /usr/java/jakarta-tomcat-4.1.24 Using CATALINA_HOME: /usr/java/jakarta-tomcat-4.1.24 Using CATALINA_TMPDIR: /usr/java/jakarta-tomcat-4.1.24/temp Using JAVA_HOME: /usr/java/j2sdk1.4.1_02 I am using ant to build a war file for my app and deploy it to tomcat. I did a find to locate where tomcat put my log4j.properties file. It put it in: $CATALINA_HOME/work/Standalone/localhost/vendor/WEB-INF/classe s/log4j.properties The catalina.out file is a bit too long to just cut and paste easily, so I am attaching the file to this email message. It appears to not be able to find the log4j.properties file and throws an exception. Any more suggestions will be appreciated. Thanks. Dean This should show which configuration file log4j load if it loads one at all. If your config file is found, you should also see log4j parsing it. BTW, your config file looks OK. At 04:56 PM 7/3/2003 -0400, Dean A. Hoover wrote: Sorry about that. It turns out that I had some tags in the web.xml file in the wrong place. I didn't realize that the order of those tags was important. Anyway. I fixed that, but the file logging is still not working. Here is the catalina.out file: 0 [main] INFO modeler.Registry - Loading registry information 2 [main] INFO modeler.Registry - Creating new Registry instance 471 [main] INFO modeler.Registry - Creating MBeanServer 1214 [main] INFO http11.Http11Protocol - Initializing Coyote HTTP/1.1 on port 8 080 Starting service Tomcat-Standalone Apache Tomcat/4.1.24 5324 [main] INFO http11.Http11Protocol - Starting Coyote HTTP/1.1 on port 8080 5438 [main] INFO common.ChannelSocket - JK2: ajp13 listening on /0.0.0.0:8009 5440 [main] INFO server.JkMain - Jk running ID=0 time=1/116 config=/usr/java/j akarta-tomcat-4.1.24/conf/jk2.properties 33445 [Thread-5] WARN common.Vendor - attempt to authenticate 'xxx' failed So, now there are no exceptions being thrown, but my log message is still going to catalina.out, despite the properties file: log4j.logger.fermataintl.migrasponder=DEBUG, l1 log4j.appender.l1=org.apache.log4j.FileAppender log4j.appender.l1.File=/tmp/migrasponder log4j.appender.l1.layout=org.apache.log4j.PatternLayout log4j.appender.l1.layout.ConversionPattern=%d{-MM-dd HH:mm:ss} %-5p %F:%L - %m%n Thanks for all your help. Do you see anything wrong with this? Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ceki For log4j documentation consider The complete log4j manual ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp - 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: DailyRollingFileAppender - why isn't rollOver protected
Hi Avner, You'll be pleased to know that Ceki has done a LOT of work on refactoring the Rolling appender stuff for Log4j 1.3 (not yet released). I can't give 100% guarantee that the new changes are what you are looking for, but suffice to say his new design should make it a lot easier to customize behaviour. Perhaps you could check out the jakarta-log4j module and see his new changes too see if it meets your needs? (we always love feedback! :) ) cheers, Paul Smith -Original Message- From: Avner BenHanoch [mailto:[EMAIL PROTECTED] Sent: Sunday, 29 June 2003 9:38 PM To: Log4J Users List Subject: DailyRollingFileAppender - why isn't rollOver protected I need to customize DailyRollingFileAppender, so rollOver will check if renaming the file is safe, before it renames it (because my application enable the user to view/query the log files). What I need is that in case the file is being read, don't rollOver, instead try again on the next time a record is appended. Unfortunately, this is not possible, because rollOver is not protected. To my opinion it should be protected, otherwise there is no real option to extend the class. If one want more details, then here they come: At first I wanted to do that by inheriting DailyRollingFileAppender and overriding subAppend. Then I noticed that it won't work (because subAppend schedules the time for next rollOver, even if current rollOver failed - so it won't happend on next time a record is appended). Then I wanted to override rollOver to raise a flag that will be inspected on next subAppend, to see if a rollOver is needed. Unfortunately, this is not possible, because rollOver is not protected. What I did to solve my problem is a little bit ugly. I copied DailyRollingFileAppender to my package without changes, changed its packagename accordingly, then I could extend it from a file in my package and called rollOver. this worked fine, but I think it is better if one could change rollOver or subAppend in DRFA, so it will be easier to extend the file. thanks, Avner - 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: is there anything in log4j that can enable me to do this.....?
Thanks for ur advice Yoav, pluggable Receivers for logging events... whats this??? Hi Michael, Receivers are the sibling of Appenders. Appenders take an event from Log4j and take them outside the log4j environment (to a file, socket, JMS topic, SMTP etc). Receivers take an external event (say, from a Socket) and push or 'post' them into their local Log4j environment. Receivers are great for getting hold of Log4j events from a remote location. Chainsaw uses them extensively. If Chainsaw wasn't enough to help you monitor events from a remote location, you could always mimic something by writing it yourself. Write a program that configures Log4j to use a Receiver to suck external events into the programs local log4j environment, then configure appenders in that same local log4j environment configured to catch the events you're interested in and react accordingly. (this is all Chainsaw does! :) ) Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Chainsaw V2 - Screenshot
[Unfortunately logj-user list has a 100k limit, so i've had to turn the screen shot into a link on the Wiki] In a reasonably desperate attempt to gather feedback from the Log4j community, I am providing a link to a screenshot of the current build of Chainsaw v2 in action that can be accessed from the jakarta-log4j-sandbox. http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages/Log4jv13Featu res [scroll down to the bottom, there is a link to click on to view the image (the above is a shorter URL)] You will see a number of the new visual changes that have been made in the new version (but by no means all of them!). I'm hoping that this screenshot may encourage anyone that has used the (excellent) original Chainsaw, and anyone who has never heard of Chainsaw, to try this new version out and assist us in quality control. Scott Deboy (the developer who kicked this new version off) and I use this version every single day in our own work environments so it's very stable. I will go out of my way to make it as easy on anyone as possible, feel free to email questions, problems etc. I can help anyone walk through getting the module checked out of CVS, and the configuration files setup for your needs. regards, Paul Smith [Thanks to Olivier Vierlinck for the great idea of putting the link to the image from the Wiki] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Chainsaw V2 - Screenshot
HI Dave, Sure! In the jakarta-log4j-sandbox/src/config there is a number of xml files that show some examples. I think out of the box if you run the ant -f chainsaw-build.xml it will automatically use the log4j-sample.xml file (this is all configured in the build.chainsaw.properties file). What I'm working on right now is support for detecting that no Receivers have been configured and prompt the user if they wish some receivers to be configured with defaults (like a SocketReceiver on port 4445). If you have an log4j log file that has been formatted with the XMLLayout, you could try just opening that file! I'll be working on more documentation as well over the next week. Comments appreciated! Paul -Original Message- From: Tauzell, Dave [mailto:[EMAIL PROTECTED] Sent: Wednesday, 18 June 2003 11:16 PM To: Log4J Users List Subject: RE: Chainsaw V2 - Screenshot I checked out from CVS and built, but I'm not sure where to go from there. Is there anything that describes what the configuration file should look like and which additional jars I'll need to run chainsaw? -Dave -Original Message- From: Paul Smith [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 18, 2003 2:45 AM To: 'Log4j-User (E-mail) (E-mail)' Subject: Chainsaw V2 - Screenshot [Unfortunately logj-user list has a 100k limit, so i've had to turn the screen shot into a link on the Wiki] In a reasonably desperate attempt to gather feedback from the Log4j community, I am providing a link to a screenshot of the current build of Chainsaw v2 in action that can be accessed from the jakarta-log4j-sandbox. http://nagoya.apache.org/wiki/apachewiki.cgi?Log4JProjectPages /Log4jv13F eatu res [scroll down to the bottom, there is a link to click on to view the image (the above is a shorter URL)] You will see a number of the new visual changes that have been made in the new version (but by no means all of them!). I'm hoping that this screenshot may encourage anyone that has used the (excellent) original Chainsaw, and anyone who has never heard of Chainsaw, to try this new version out and assist us in quality control. Scott Deboy (the developer who kicked this new version off) and I use this version every single day in our own work environments so it's very stable. I will go out of my way to make it as easy on anyone as possible, feel free to email questions, problems etc. I can help anyone walk through getting the module checked out of CVS, and the configuration files setup for your needs. regards, Paul Smith [Thanks to Olivier Vierlinck for the great idea of putting the link to the image from the Wiki] - 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: Chainsaw Question
Hi everybody, Hi Egan, The initial suggestion was to put a session id or an ip address with each debug statement and separate them using grep. A later proposal was to use something like chainsaw to generate a separate logfile for each user. (Is this possible with chainsaw???) As one of the developers working on Chainsaw v2, I can say that Chainsaw's probably not the best way to go with this. It's great for viewing log entries as they happen (particularly from multiple remote sources simultaneously), or browsing a log xml file, but I can't really think of how Chainsaw will help you here. I'd go with the standard log4j approach, with filters by NDC, or even filter by properties. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ASYNC Appender not printing line or class information
*Threshold - no idea what this does Just like you can set the threshold for the hierarchy, and loggers/categories to restrict events going any further down if it is not that level or Higher, you can do the same thing for any appender (that extend from AppenderSkeleton). This is VERY handy for attaching separate appenders to the same logger. You have INFO level logs for a Logger going to a file, but ERROR only going via SMTP to someone. Ceki's book is excellent, I think everyone should have it in their toolbelt. cheers, Paul Smith - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]