Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 82785 invoked from network); 2 Nov 2009 03:56:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Nov 2009 03:56:59 -0000 Received: (qmail 76914 invoked by uid 500); 2 Nov 2009 03:56:58 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 76851 invoked by uid 500); 2 Nov 2009 03:56:56 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 76841 invoked by uid 99); 2 Nov 2009 03:56:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 03:56:56 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 209.85.160.54 as permitted sender) Received: from [209.85.160.54] (HELO mail-pw0-f54.google.com) (209.85.160.54) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 03:56:51 +0000 Received: by pwi18 with SMTP id 18so1795172pwi.13 for ; Sun, 01 Nov 2009 19:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FECoH3ME3O95I/ou9Wy2pJ3YHZyLlt4YSx5z6gzEeFw=; b=UnqYX2E018cUCW1bhirv2hvKtvshmcE0FmD75I2vIM/e7zLrVzbx54nAwkSupxIz+I +NJu2JzCLYfj+/42LZKkudIHiP547fxv8U7le6RAxi7RGrCIxKVUAWe95gMLxMNbsowA IDuJHM3uKhi4FDxPKCz7Nk4dS1dJ66MuzsAUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=tdSS936hbLKesyht9TqtdmfJvJigMZfkpoPAPDJjC8t1I5XX2kzYiu1crbc66Zy5yr kaHwGDD1sNJePqfEgoZBVZXufdbL+DTS0eb3DMmfNOSaJfG/w29INtJIRpDibUKRf+oI T+99MygIZqqKeDtM/1V0kUlgPB77ctcZJTwSw= MIME-Version: 1.0 Received: by 10.140.193.15 with SMTP id q15mr248370rvf.161.1257134190845; Sun, 01 Nov 2009 19:56:30 -0800 (PST) In-Reply-To: <197ABABFC98D48D58ABA85256721ADF0@david> References: <6974DCCE6A1249198F03705F227DCB31@david> <4483c26c0911011716t3eabe917k23b7fa8223edfc8b@mail.gmail.com> <197ABABFC98D48D58ABA85256721ADF0@david> Date: Sun, 1 Nov 2009 19:56:30 -0800 Message-ID: <4483c26c0911011956o152387f1i21fef4c03cda96c2@mail.gmail.com> Subject: Re: Is there a sampler that can read a tomcat log file? From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=000e0cd2118ee1600f04775b5c02 --000e0cd2118ee1600f04775b5c02 Content-Type: text/plain; charset=ISO-8859-1 hi while you might have a good reason for trying to access the tomcat logs , it's still seems to me,to be an overkill. If there is an error the status code returned shouldn't be 200 (though of course some apps return a 200 code page with an error message, but there is still some text that differentiates an error from a normal success. And in most case's you should be able to assert the text on a page response to validate that you were successful. An equivalent problem that people run into sometimes is something like place an order and they want to verify that there is an Order line in the database. this is more simply solved if you had a page that retrieves orders and you assert that the order is present there. What i'm trying to indicate is that there *usually* is some way that the site itself can tell you whether or not something went wrong. The other reasons against implementing something tomcat specific is that it wont work for say jetty/weblogic. You might have to change if you decide to log errors using log4j, you might run into issues if you cluster tomcat without session pinning. So unless there is absolutely no other way than reading the logs to determine success/ failure I wouldn't do what you are planning. regards deepak On Sun, Nov 1, 2009 at 7:26 PM, David Levine wrote: > Thanks Deepak, you always have very thoughtful replies. > > I'm trying to make sure that a particular functional path through JMeter > results in particular lines in the tomcat log file. I also want to make > sure a particular functional path results in no ERRORS being logged in the > tomcat log file. Your idea about writing a service that just returns the > log lines I want is pretty much what I was thinking of doing, only I was > thinking of writing a custom sampler to wrap up the service. It's a lot > less work to do just what you're suggesting though. > > If anyone else would find this web service useful for your JMeter test, let > me know and I'll post the source somewhere. > > David > > -------------------------------------------------- > From: "Deepak Shetty" > Sent: Sunday, November 01, 2009 5:16 PM > To: "JMeter Users List" > Subject: Re: Is there a sampler that can read a tomcat log file? > > > Hi >> what are you trying to assert in the logs? Ideally your response and >> response code should tell you everything you need to know. >> >> You need not necessarily have to extend Jmeter (you could just have a JSP >> page / code on tomcat ) which returns whatever you want (that is you don't >> need any Special Log Sampler , any HTTP/Web Service sampler should work >> just >> as well). >> >> regards >> deepak >> >> On Sun, Nov 1, 2009 at 5:06 PM, David Levine >> wrote: >> >> Hi, >>> >>> As part of my functional test, I'd like to assert that a particular line >>> is >>> present (or not present) in the tomcat log file for my application. After >>> looking around at the available samplers and other JMeter tricks, it >>> doesn't >>> look like there's a way to do this without writing code and extending >>> JMeter. Am I correct or is there a way to do this? >>> >>> OK, there's one kind of hacky way I thought of doing this, which is to >>> write a web service that returns the tomcat log as an XML document, and >>> then >>> use an HTTP Request along with an XPath Extractor post processor, and >>> look >>> for the log line I'm looking for. But that means I'd have to send back >>> the >>> whole log file every time, which could be huge - so I don't like that. >>> >>> So I was thinking of writing a new sampler, called maybe the Tomcat Log >>> Sampler, that let's you specify a regex query for log lines that you're >>> looking for, and then returns those as XML, so that you can use the XPath >>> Extractor to pull the log lines you're looking for into a variable which >>> you >>> can then subsequently use. The Tomcat Log Sampler would really just be a >>> proxy for a new web service I'd write, that would need to be running on >>> the >>> tomcat web server. The Tomcat Log Web Service would perform the actual >>> query and return the results. That way it could scale. >>> >>> OK, does this make any sense or am I way off somewhere? >>> >>> David >>> >> >> > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --000e0cd2118ee1600f04775b5c02--