You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by David Gerler <dg...@gmail.com> on 2010/09/20 19:22:50 UTC
Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like
is the fact that it appends the date to the end of the filename like
"root.txt20100920". We'd like to have it insert the date in the middle like
"root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also
tried inserting [%date] in the filename in the config file, but that didn't
work.
Re: Date Rollover filename
Posted by Chris White <cw...@gmail.com>.
David,
I do not. I was curious because I hadn't thought of looking into it until I saw your email (although I've periodically had the same question but obviously never investigated). Where the other properties are lower-case at the first position you might try "preserveLogFileNameExtension".
Chris
On Sep 20, 2010, at 2:32 PM, David Gerler wrote:
> Michael,
> Other than still having the .txt in the middle of the file name, it works nicely. Well enough for our use in fact.
>
> Chris,
> Do you have an example of how to use it? I tried:
>
> <appender name="Root" type="log4net.Appender.RollingFileAppender">
> <file value="c:/log/synch/root.txt" />
> <appendToFile value="true" />
> <maxSizeRollBackups value="10" />
> <PreserveLogFileNameExtension value="true">
> <datePattern value="yyyy-MM-dd" />
> <rollingStyle value="Date" />
> <staticLogFileName value="true" />
> <layout type="log4net.Layout.PatternLayout">
> <header value="[Header]
"/>
> <footer value="[Footer]
"/>
> <conversionPattern value="%date [%thread] %-5level %logger (%file:%line) - %message%newline" />
> </layout>
> </appender>
>
> From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com]
> Sent: Monday, September 20, 2010 1:00 PM
> To: log4net-user@logging.apache.org
> Subject: RE: Date Rollover filename
>
> Yes - you need to set the datePattern value for the appender. Something like this
>
> <appender name="RollingDebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
> <file value="..\\Data\\Logs\\debug" />
> <appendToFile value="true" />
> <rollingStyle value="Composite" />
> <staticLogFileName value="false" />
> <datePattern value=".yyyy-MM-dd.lo\g" />
> and you would set yours to
> <datePattern value=".yyyy-MM-dd.txt" />
> Hope this helps.
> From: David Gerler [mailto:dgerler@gmail.com]
> Sent: Monday, September 20, 2010 10:23 AM
> To: log4net-user@logging.apache.org
> Subject: Date Rollover filename
>
> We are using the Date rollover style for our logs. The thing we don’t like is the fact that it appends the date to the end of the filename like “root.txt20100920”. We’d like to have it insert the date in the middle like “root20100920.txt”. Is that possible?
>
> I have searched the documentation and can’t seem to find anything. I also tried inserting [%date] in the filename in the config file, but that didn’t work.
Re: Is there an SMTP appender limit
Posted by Michael Schall <mi...@gmail.com>.
10 should be fine, but you could always use a distribution list.
Mike
On Oct 1, 2010, at 11:26 PM, Ron Grabowski <ro...@yahoo.com> wrote:
> Whatever the Framework's limit is for MailMessage's To property. You'll probably
> be limited by whatever the mail server is setup to accept.
>
>
>
> ----- Original Message ----
> From: "harry.douglass@pnc.com" <ha...@pnc.com>
> To: Log4NET User <lo...@logging.apache.org>
> Sent: Thu, September 30, 2010 10:41:19 AM
> Subject: Is there an SMTP appender limit
>
> Just curious if there is any limit for the "to value" for the SmtpAppender.
> I have about 10 emails I need to put in the to value, so is that ok?
>
> Thanks,
>
> Harry
>
> The contents of this email are the property of PNC. If it was not addressed to
> you, you have no legal right to read it. If you think you received it in error,
> please notify the sender. Do not forward or copy without permission of the
> sender. This message may contain an advertisement of a product or service and
> thus may constitute a commercial electronic mail message under US Law. The
> postal address for PNC is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not
> wish to receive any additional advertising or promotional messages from PNC at
> this e-mail address, click here to unsubscribe.
> https://pnc.p.delivery.net/m/u/pnc/uni/p.asp By unsubscribing to this message,
> you will be unsubscribed from all advertising or promotional messages from PNC.
> Removing your e-mail address from this mailing list will not affect your
> subscription to alerts, e-newsletters or account servicing e-mails.
>
Re: Is there an SMTP appender limit
Posted by Ron Grabowski <ro...@yahoo.com>.
Whatever the Framework's limit is for MailMessage's To property. You'll probably
be limited by whatever the mail server is setup to accept.
----- Original Message ----
From: "harry.douglass@pnc.com" <ha...@pnc.com>
To: Log4NET User <lo...@logging.apache.org>
Sent: Thu, September 30, 2010 10:41:19 AM
Subject: Is there an SMTP appender limit
Just curious if there is any limit for the "to value" for the SmtpAppender.
I have about 10 emails I need to put in the to value, so is that ok?
Thanks,
Harry
The contents of this email are the property of PNC. If it was not addressed to
you, you have no legal right to read it. If you think you received it in error,
please notify the sender. Do not forward or copy without permission of the
sender. This message may contain an advertisement of a product or service and
thus may constitute a commercial electronic mail message under US Law. The
postal address for PNC is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not
wish to receive any additional advertising or promotional messages from PNC at
this e-mail address, click here to unsubscribe.
https://pnc.p.delivery.net/m/u/pnc/uni/p.asp By unsubscribing to this message,
you will be unsubscribed from all advertising or promotional messages from PNC.
Removing your e-mail address from this mailing list will not affect your
subscription to alerts, e-newsletters or account servicing e-mails.
Is there an SMTP appender limit
Posted by ha...@pnc.com.
Just curious if there is any limit for the "to value" for the SmtpAppender.
I have about 10 emails I need to put in the to value, so is that ok?
Thanks,
Harry
The contents of this email are the property of PNC. If it was not addressed to you, you have no legal right to read it. If you think you received it in error, please notify the sender. Do not forward or copy without permission of the sender. This message may contain an advertisement of a product or service and thus may constitute a commercial electronic mail message under US Law. The postal address for PNC is 249 Fifth Avenue, Pittsburgh, PA 15222. If you do not wish to receive any additional advertising or promotional messages from PNC at this e-mail address, click here to unsubscribe. https://pnc.p.delivery.net/m/u/pnc/uni/p.asp By unsubscribing to this message, you will be unsubscribed from all advertising or promotional messages from PNC. Removing your e-mail address from this mailing list will not affect your subscription to alerts, e-newsletters or account servicing e-mails.
RE: Date Rollover filename
Posted by David Gerler <dg...@gmail.com>.
Yes. Thank you.
From: Radovan Raszka [mailto:raszka@hasam.cz]
Sent: Tuesday, September 21, 2010 1:16 AM
To: Log4NET User
Subject: RE: Date Rollover filename
Please notice, that <file value="..\\Data\\Logs\\debug" /> _doesn't_ contain
extension.
Your config should be like this:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<datePattern value="yyyy-MM-dd.txt" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread]
%-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
Now log files will have names in form root2010-09-21.txt (for today's date)
Radovan
_____
Od: David Gerler [mailto:dgerler@gmail.com]
Odesláno: 20. září 2010 20:32
Komu: 'Log4NET User'
Předmět: RE: Date Rollover filename
Michael,
Other than still having the .txt in the middle of the file name, it works
nicely. Well enough for our use in fact.
Chris,
Do you have an example of how to use it? I tried:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<PreserveLogFileNameExtension value="true">
<datePattern value="yyyy-MM-dd" />
<rollingStyle value="Date" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread]
%-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com]
Sent: Monday, September 20, 2010 1:00 PM
To: log4net-user@logging.apache.org
Subject: RE: Date Rollover filename
Yes - you need to set the datePattern value for the appender. Something
like this
<appender name="RollingDebugLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\\Data\\Logs\\debug" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<datePattern value=".yyyy-MM-dd.lo\g" />
and you would set yours to
<datePattern value=".yyyy-MM-dd.txt" />
Hope this helps.
_____
From: David Gerler [mailto:dgerler@gmail.com]
Sent: Monday, September 20, 2010 10:23 AM
To: log4net-user@logging.apache.org
Subject: Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like
is the fact that it appends the date to the end of the filename like
"root.txt20100920". We'd like to have it insert the date in the middle like
"root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also
tried inserting [%date] in the filename in the config file, but that didn't
work.
Re: Date Rollover filename
Posted by Lee Chun Kit <ch...@gmail.com>.
David Gerler <dgerler <at> gmail.com> writes:
>
>
> It should be noted as well that I had to escape the t’s in txt.
>
> yyyy-MM-dd.\tx\t
>
Log4Net's DatePattern uses SimpleDateFormatter which uses .NET's
DateTime.ToString() method so this works as well:
<datePattern value="yyyy-MM-dd.'txt'" />
Links:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
RE: Date Rollover filename
Posted by Radovan Raszka <ra...@hasam.cz>.
Yes, I didn't tested suggested configuration, but some chars used as standard formatting strings must be escaped in order to preserve them.
________________________________
Od: David Gerler [mailto:dgerler@gmail.com]
Odesláno: 21. září 2010 16:08
Komu: 'Log4NET User'
Předmět: RE: Date Rollover filename
It should be noted as well that I had to escape the t's in txt.
yyyy-MM-dd.\tx\t
From: Radovan Raszka [mailto:raszka@hasam.cz]
Sent: Tuesday, September 21, 2010 1:16 AM
To: Log4NET User
Subject: RE: Date Rollover filename
Please notice, that <file value="..\\Data\\Logs\\debug" /> _doesn't_ contain extension.
Your config should be like this:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<datePattern value="yyyy-MM-dd.txt" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread] %-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
Now log files will have names in form root2010-09-21.txt (for today's date)
Radovan
RE: Date Rollover filename
Posted by David Gerler <dg...@gmail.com>.
It should be noted as well that I had to escape the t's in txt.
yyyy-MM-dd.\tx\t
From: Radovan Raszka [mailto:raszka@hasam.cz]
Sent: Tuesday, September 21, 2010 1:16 AM
To: Log4NET User
Subject: RE: Date Rollover filename
Please notice, that <file value="..\\Data\\Logs\\debug" /> _doesn't_ contain
extension.
Your config should be like this:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<datePattern value="yyyy-MM-dd.txt" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread]
%-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
Now log files will have names in form root2010-09-21.txt (for today's date)
Radovan
_____
Od: David Gerler [mailto:dgerler@gmail.com]
Odesláno: 20. září 2010 20:32
Komu: 'Log4NET User'
Předmět: RE: Date Rollover filename
Michael,
Other than still having the .txt in the middle of the file name, it works
nicely. Well enough for our use in fact.
Chris,
Do you have an example of how to use it? I tried:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<PreserveLogFileNameExtension value="true">
<datePattern value="yyyy-MM-dd" />
<rollingStyle value="Date" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread]
%-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com]
Sent: Monday, September 20, 2010 1:00 PM
To: log4net-user@logging.apache.org
Subject: RE: Date Rollover filename
Yes - you need to set the datePattern value for the appender. Something
like this
<appender name="RollingDebugLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\\Data\\Logs\\debug" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<datePattern value=".yyyy-MM-dd.lo\g" />
and you would set yours to
<datePattern value=".yyyy-MM-dd.txt" />
Hope this helps.
_____
From: David Gerler [mailto:dgerler@gmail.com]
Sent: Monday, September 20, 2010 10:23 AM
To: log4net-user@logging.apache.org
Subject: Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like
is the fact that it appends the date to the end of the filename like
"root.txt20100920". We'd like to have it insert the date in the middle like
"root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also
tried inserting [%date] in the filename in the config file, but that didn't
work.
RE: Date Rollover filename
Posted by Radovan Raszka <ra...@hasam.cz>.
Please notice, that <file value="..\\Data\\Logs\\debug" /> _doesn't_ contain extension.
Your config should be like this:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<datePattern value="yyyy-MM-dd.txt" />
<rollingStyle value="Date" />
<staticLogFileName value="false" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread] %-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
Now log files will have names in form root2010-09-21.txt (for today's date)
Radovan
________________________________
Od: David Gerler [mailto:dgerler@gmail.com]
Odesláno: 20. září 2010 20:32
Komu: 'Log4NET User'
Předmět: RE: Date Rollover filename
Michael,
Other than still having the .txt in the middle of the file name, it works nicely. Well enough for our use in fact.
Chris,
Do you have an example of how to use it? I tried:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<PreserveLogFileNameExtension value="true">
<datePattern value="yyyy-MM-dd" />
<rollingStyle value="Date" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread] %-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com]
Sent: Monday, September 20, 2010 1:00 PM
To: log4net-user@logging.apache.org
Subject: RE: Date Rollover filename
Yes - you need to set the datePattern value for the appender. Something like this
<appender name="RollingDebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="..\\Data\\Logs\\debug" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<datePattern value=".yyyy-MM-dd.lo\g" />
and you would set yours to
<datePattern value=".yyyy-MM-dd.txt" />
Hope this helps.
________________________________
From: David Gerler [mailto:dgerler@gmail.com]
Sent: Monday, September 20, 2010 10:23 AM
To: log4net-user@logging.apache.org
Subject: Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like is the fact that it appends the date to the end of the filename like "root.txt20100920". We'd like to have it insert the date in the middle like "root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also tried inserting [%date] in the filename in the config file, but that didn't work.
RE: Date Rollover filename
Posted by David Gerler <dg...@gmail.com>.
Michael,
Other than still having the .txt in the middle of the file name, it works
nicely. Well enough for our use in fact.
Chris,
Do you have an example of how to use it? I tried:
<appender name="Root" type="log4net.Appender.RollingFileAppender">
<file value="c:/log/synch/root.txt" />
<appendToFile value="true" />
<maxSizeRollBackups value="10" />
<PreserveLogFileNameExtension value="true">
<datePattern value="yyyy-MM-dd" />
<rollingStyle value="Date" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<header value="[Header]
"/>
<footer value="[Footer]
"/>
<conversionPattern value="%date [%thread]
%-5level %logger (%file:%line) - %message%newline" />
</layout>
</appender>
From: Lansdaal, Michael T [mailto:michael.t.lansdaal@boeing.com]
Sent: Monday, September 20, 2010 1:00 PM
To: log4net-user@logging.apache.org
Subject: RE: Date Rollover filename
Yes - you need to set the datePattern value for the appender. Something
like this
<appender name="RollingDebugLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="..\\Data\\Logs\\debug" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<datePattern value=".yyyy-MM-dd.lo\g" />
and you would set yours to
<datePattern value=".yyyy-MM-dd.txt" />
Hope this helps.
_____
From: David Gerler [mailto:dgerler@gmail.com]
Sent: Monday, September 20, 2010 10:23 AM
To: log4net-user@logging.apache.org
Subject: Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like
is the fact that it appends the date to the end of the filename like
"root.txt20100920". We'd like to have it insert the date in the middle like
"root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also
tried inserting [%date] in the filename in the config file, but that didn't
work.
RE: Date Rollover filename
Posted by "Lansdaal, Michael T" <mi...@boeing.com>.
Yes - you need to set the datePattern value for the appender. Something like this
<appender name="RollingDebugLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="..\\Data\\Logs\\debug" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<staticLogFileName value="false" />
<datePattern value=".yyyy-MM-dd.lo\g" />
and you would set yours to
<datePattern value=".yyyy-MM-dd.txt" />
Hope this helps.
________________________________
From: David Gerler [mailto:dgerler@gmail.com]
Sent: Monday, September 20, 2010 10:23 AM
To: log4net-user@logging.apache.org
Subject: Date Rollover filename
We are using the Date rollover style for our logs. The thing we don't like is the fact that it appends the date to the end of the filename like "root.txt20100920". We'd like to have it insert the date in the middle like "root20100920.txt". Is that possible?
I have searched the documentation and can't seem to find anything. I also tried inserting [%date] in the filename in the config file, but that didn't work.
Re: Date Rollover filename
Posted by Chris White <cw...@gmail.com>.
On Sep 20, 2010, at 1:22 PM, David Gerler wrote:
> We are using the Date rollover style for our logs. The thing we don’t like is the fact that it appends the date to the end of the filename like “root.txt20100920”. We’d like to have it insert the date in the middle like “root20100920.txt”. Is that possible?
>
> I have searched the documentation and can’t seem to find anything. I also tried inserting [%date] in the filename in the config file, but that didn’t work.
Looking at the code in repository for the RollingFileAppender there appears to be a property called PreserveLogFileNameExtension which ay do what you want.