Return-Path: Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: (qmail 6777 invoked from network); 2 Dec 2004 17:10:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 17:10:26 -0000 Received: (qmail 99240 invoked by uid 500); 2 Dec 2004 17:10:18 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 99216 invoked by uid 500); 2 Dec 2004 17:10:18 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 99201 invoked by uid 99); 2 Dec 2004 17:10:17 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO,RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.shs.siemens.com (HELO mail.shs.siemens.com) (64.46.248.224) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 09:10:15 -0800 Received: from mlvv9m1x.shs.siemens.com (unknown [165.226.204.11]) by mail.shs.siemens.com (Postfix) with ESMTP id 407AD38746 for ; Thu, 2 Dec 2004 11:37:19 -0500 (EST) Received: from MLVV9MBA.ww005.siemens.net (mlvv9mba.smshsc.net [165.226.204.44]) by mlvv9m1x.shs.siemens.com (8.12.11/8.12.10) with ESMTP id iB2GbCk2007556 for ; Thu, 2 Dec 2004 11:37:12 -0500 Received: from mlvexc01.smshsc.net ([165.226.249.73]) by 165.226.204.44 with InterScan Messaging Security Suite; Thu, 02 Dec 2004 11:34:26 -0500 Received: by MLVEXC01 with Internet Mail Service (5.5.2657.72) id ; Thu, 2 Dec 2004 11:38:48 -0500 Message-ID: <47595B04C59BDE4592F43A57C9ED8FAC06580424@mlvv9mle.ww005.siemens.net> From: Currimbhoy Shahyan To: "'Log4J Users List'" Subject: RE: Unable to populate 'Class', 'Method', 'Line' and 'File' field s within Chainsaw Date: Thu, 2 Dec 2004 11:39:17 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="windows-1252" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I have tried that too. For some reason Chainsaw does not recognize my log file. Log4j generates the log file and puts it in the correct directory. Nothing comes up in Chainsaw though when I run my progam. There are no error messages or anything generated either. These are my Chainsaw configs: fileURL: file:///c:/events.log logFormat: TIMESTAMP LEVEL [THREAD] CLASS (FILE:LINE) - MESSAGE name: appender tailing: true timestampFormat: yyyy-MM-d HH:mm:ss,SSS My log4j config contains (seems to generate the log file correctly): -----Original Message----- From: Scott Deboy [mailto:sdeboy@comotivsystems.com] Sent: Thursday, December 02, 2004 10:33 AM To: Log4J Users List Subject: RE: Unable to populate 'Class', 'Method', 'Line' and 'File' fields within Chainsaw SocketAppender doesn't use a layout - socketAppender sends serialized logging events over the wire. Are you using a log4j1.2.8 jar on the source side? If so, you can't get location info fields in Chainsaw V2 using a SocketAppender - the serialization of events changed between 1.2.8 and 1.3. You can receive events from a 1.2.8 SocketAppender, but only if the events don't contain location info. If you're using a 1.2.8 jar on the source side, you can still get location info in Chainsaw by following these steps: 1. On the source side, define a FileAppender using a conversion pattern that includes line/file/method etc patterns. 2. In Chainsaw, define a LogFilePatternReceiver, specifying the URL to your log file and the logFormat (pattern) in the file (see the JavaDoc - available from Chainsaw's help menu, for info no how to configure a LogFilePatternReceiver). 3. Don't forget to set 'tailing' to true if you want to view the events in Chainsaw as they are written to the file. If you're using a 1.3 jar on the source side, add a 'locationInfo' param (set to true) to the SocketAppender configuration and Chainsaw will display location info. Hope that helps Scott -----Original Message----- From: Currimbhoy Shahyan [mailto:Shahyan.Currimbhoy@siemens.com] Sent: Thu 12/2/2004 6:55 AM To: 'Log4J Users List' Cc: Subject: Unable to populate 'Class', 'Method', 'Line' and 'File' fields within Chainsaw I am using Chainsaw to view logs generated via Log4j however I can't seem to get anything inside the 'Class', 'Method', 'Line' and 'File' fields within Chainsaw. I seem to get '?' inside all those fields. I am trying to set the layout using Conversion Pattern however it doesn't seem to recognize it. No matter what I put in the conversion pattern, it only populates the standard fields (level, logger, time, thread, message). When I tried setting the Conversion pattern for the Console Appender, I can view the correct values in the Class, Method, Line and File fields. Is there something additional I need to do in order to view these fields inside Chainsaw. I am using a normal SocketAppender with the following snipet from Log4j.xml: -----Original Message----- From: Adriano Labate [mailto:adriano.labate@sportaccess.com] Sent: Thursday, December 02, 2004 6:44 AM To: Log4J Users List Subject: RE: Multiple DailyRollingFileAppender on the same file : renaming fails Hi, I tested a log4j configuration where I have 2 DailyRollingFileAppender pointing to the same physical file and having a different PatternLayout. The first one is used by the root logger and the second one by an explicit logger. In my previous post, I used this configuration on a Oracle JVM, now on a standard Sun JVM. In both cases, when it's time to rollover the file, the renaming fails. The reason is that each appender maintains a handle on the file resulting in two handles, that creates a lock and the renaming always fails and the previous log content is lost. ----------------------------------------------------- Handle v2.2 Copyright (C) 1997-2004 Mark Russinovich Sysinternals - www.sysinternals.com java.exe pid: 1876 C:\transferService.log java.exe pid: 1876 C:\transferService.log ----------------------------------------------------- I wonder whether it is the correct behavior ? It seems to me that log4j has a full control on its configuration and could handle this situation. Maybe this could be fixed in version 1.3 ? Adriano Labate -----Message d'origine----- De : Adriano Labate [mailto:adriano.labate@sportaccess.com] Envoy� : mercredi, 1 d�cembre 2004 17:06 � : log4j-user@logging.apache.org Objet : Multiple DailyRollingFileAppender on the same file : renaming fails Hi, I just resolved a problem with the DailyRollingFileAppender and I just want to share my experience with others. If it can help someone... When it was time to rollover the file, I got the error: "log4j:ERROR Failed to rename [c:/temp/mspak/monitoring/transferService.log] to [c:/temp/mspak/monitoring/transferService.log.2004-11-25.log]." I search on Google for this error and found around 200 results and realized that it was a problem for a lot of people. As I use log4j with the Oracle JVM I supposed that it was an Oracle issue with I/O or permissions. After a lot of discussions with the Oracle support, it was definitely not the case. I noted that a lot of discussions talked about the possibility that the file has a handle on it that prevents log4j to rename the file. To be sure I installed and run 2 tools from www.sysinternals.com : Handle and Process Explorer. Running Handle I got : -------------- C:\>handle -u transferservice.log Handle v2.2 Copyright (C) 1997-2004 Mark Russinovich Sysinternals - www.sysinternals.com oracle.exe pid: 984 AUTORITE NT\SYSTEM C:\TEMP\MSPAK\monitoring\transferService.log oracle.exe pid: 984 AUTORITE NT\SYSTEM C:\TEMP\MSPAK\monitoring\transferService.log -------------- There was indeed two handles on my log file. I double checked with Process Explorer (a GUI app) and confirmed that Oracle maintained two handles on my log file. Now I was sure that it was a file handle problem. Then I got a flash and realized that in my log4j.xml configuration file I have two daily rolling file appenders that pointed on the same physical file. I tried to keep only one of them. Retried and YES, there was now only one handle on the file! Tested the rollover and it finally worked! My configuration file was : -------------- -------------- I have now a question: I didn't tried to use that configuration outside of Oracle, is it wrong to use 2 appenders pointing on the same file (windows xp) ? I searched on the G�lc� log4j manual but didn't found anything. Has anyone tried to use this kind of configuration ? I know that the Oracle JVM handles the threading differently than the Sun JVM, so it can also explain the problem. Adriano Labate --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org ---------------------------------------------------------------------------- --- This message and any included attachments are from Siemens Medical Solutions USA, Inc. and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to Central.SecurityOffice@shs.siemens.com Thank you --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org ------------------------------------------------------------------------------- This message and any included attachments are from Siemens Medical Solutions USA, Inc. and are intended only for the addressee(s). The information contained herein may include trade secrets or privileged or otherwise confidential information. Unauthorized review, forwarding, printing, copying, distributing, or using such information is strictly prohibited and may be unlawful. If you received this message in error, or have reason to believe you are not authorized to receive it, please promptly delete this message and notify the sender by e-mail with a copy to Central.SecurityOffice@shs.siemens.com Thank you --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org