Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 1729 invoked from network); 7 Nov 2006 04:29:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2006 04:29:45 -0000 Received: (qmail 36304 invoked by uid 500); 7 Nov 2006 04:29:54 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 36289 invoked by uid 500); 7 Nov 2006 04:29:54 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 36278 invoked by uid 99); 7 Nov 2006 04:29:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Nov 2006 20:29:54 -0800 X-ASF-Spam-Status: No, hits=3.1 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS,RCVD_IN_NJABL_PROXY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [68.142.200.115] (HELO web30502.mail.mud.yahoo.com) (68.142.200.115) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 06 Nov 2006 20:29:39 -0800 Received: (qmail 63547 invoked by uid 60001); 7 Nov 2006 04:29:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=mXxrYeE8YW1n4L0rdsxTmPqpLPNCJCUBzFrQ8bDzMgBUOYEuSnfvnE1ksPj402INVlC9Pq4lllh/Q4QUej8sAZSoqNLsYLlJWWyKVsJkxGpsTfUztWU5TT2ghGcDJC+8dn1mfk9gTzEXlIce3GyzcD6HpebHbn11NcVUj7AWE3I= ; Message-ID: <20061107042918.63545.qmail@web30502.mail.mud.yahoo.com> Received: from [24.208.153.243] by web30502.mail.mud.yahoo.com via HTTP; Mon, 06 Nov 2006 20:29:18 PST Date: Mon, 6 Nov 2006 20:29:18 -0800 (PST) From: Ron Grabowski Subject: Re: Possible To Name Log File After Assembly? To: Log4NET User MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org =0ASomeone had suggested this feature over a year ago:=0A=0Ahttp://issues.a= pache.org/jira/browse/LOG4NET-10=0A=0AThey suggested using the %v pattern. = Which value do you want outputed:=0A=0A Assembly.GetCallingAssembly()=0A As= sembly.GetEntryAssembly()=0A Assembly.GetExecutingAssembly()=0A=0ADo you ha= ve any suggestions for what the other useful names would be? Since these pa= tterns probably won't get used as often as some of the other patterns, I th= ink its ok to use longer, more descriptive names (I don't know if these wou= ld give you log4net information or information from your application):=0A= =0A %callingAssembly=0A %entryAssembly=0A %executingAssembly=0A=0ALocationI= nformation doesn't store the System.Type of the LoggingEvent (for serializa= tion reasons?). One solution would be to write a small helper function that= translates the ClassName string into the appropriate Type (or Assembly):= =0A=0A// untested=0Apublic class CallingAssemblyPatternConverter : PatternL= ayoutConverter =0A{=0A override protected void Convert(TextWriter writer, L= oggingEvent loggingEvent)=0A {=0A Type locationInformationType =3D getType= ForClassNameloggingEvent.LocationInformation.ClassName);=0A writer.Write(l= ocationInformationType.Assembly.FullName);=0A }=0A}=0A=0AA more clever way = may be to extract the assembly name from the full qualified ClassName strin= g:=0A=0Awriter.Write(loggingEvent.LocationInformation.ClassName.Split(',')[= 1]);=0A=0AThe problem with the Split() method is that you will may get extr= a information like versioning information.=0A=0A=0A----- Original Message -= ---=0A=0AFrom: Milad Ershaghi =0A=0ATo: log4net-user@lo= gging.apache.org=0A=0ASent: Monday, November 6, 2006 9:29:58 PM=0A=0ASubjec= t: Possible To Name Log File After Assembly?=0A=0A=0A=0ADear Community,=0A= =0A=0A=0AI was wondering if it is possible to name a log file after an asse= mbly=0A=0Avia the config file. Here is my config file:=0A=0A=0A=0A--=0A=0A= =0A=0A=0A=0A=0A=0A= =0A=0A
=0A=0A =0A=0A= =0A=0A =0A=0A = =0A=0A =0A=0A =0A=0A =0A=0A =0A=0A = =0A=0A =0A=0A =0A=0A = =0A=0A =0A=0A =
=0A= =0A