FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-17-2010, 05:59 PM
vr
 
Default Put date on log file names?

Due to message volume, I'm considering rotating my mail logs daily at my
local time "midnight" and retaining about 30 days worth of files on
disk. I'd like to have the date in the file names so visually I'll know
what span is in each file.


Can this be done? (put dates into the file name)

Should this be done? (put the date into the file name)

If you're doing something like this already, how did you do it?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4BF183E6.6020400@iotk.net">http://lists.debian.org/4BF183E6.6020400@iotk.net
 
Old 05-17-2010, 06:13 PM
Chris Jackson
 
Default Put date on log file names?

vr wrote:

Due to message volume, I'm considering rotating my mail logs daily at my
local time "midnight" and retaining about 30 days worth of files on
disk. I'd like to have the date in the file names so visually I'll know
what span is in each file.


Can this be done? (put dates into the file name)



You need the dateext option in the logrotate config. That'll mean your
archives have the date extension, and the current one is just whatever
it's normally called, which I guess should be OK for you?



Should this be done? (put the date into the file name)



Never caused me any problems

--
Chris Jackson
Shadowcat Systems Ltd.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Archive: 4BF1874F.60209@shadowcat.co.uk">http://lists.debian.org/4BF1874F.60209@shadowcat.co.uk
 
Old 05-17-2010, 06:40 PM
Camaleón
 
Default Put date on log file names?

On Mon, 17 May 2010 13:59:02 -0400, vr wrote:

> Due to message volume, I'm considering rotating my mail logs daily at my
> local time "midnight" and retaining about 30 days worth of files on
> disk. I'd like to have the date in the file names so visually I'll know
> what span is in each file.
>
> Can this be done? (put dates into the file name)

Sure, I do :-)

man logrotate → dateext

> Should this be done? (put the date into the file name)

Sure, I do in my "fetchmail" logs :-)

> If you're doing something like this already, how did you do it?

By defining "dateext" variable info the "logrotate" script.

***
dateext
Archive old versions of log files adding a daily extension like
YYYYMMDD instead of simply adding a number.
***

Greetings,

--
Camaleón


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: pan.2010.05.17.18.40.51@gmail.com">http://lists.debian.org/pan.2010.05.17.18.40.51@gmail.com
 
Old 05-17-2010, 09:12 PM
Timo Boettcher
 
Default Put date on log file names?

Hi!

* vr <debian-user@iotk.net> wrote:
> I'd like to have the date in the file names so visually I'll know
> what span is in each file.
>
> Can this be done? (put dates into the file name)
Depends. See the other posts about logrotate
> Should this be done? (put the date into the file name)
No clue

> If you're doing something like this already, how did you do it?
I am logging to syslog (the protocol) and replaced syslog (the package)
with syslog-ng. syslog-ng can be configured to do this:

destination df_syslog {
file("/var/log/$HOST/$YEAR/$MONTH/$DAY/syslog"
template("$ISODATE $HOST $MSG
")
owner(root) group(root) perm(0600) dir_perm(0700) create_dirs(yes));
};

This is a snipped that configures a file in a directory-structure matching
the hostname and the date (you should be able to guess the details...)

http://www.syslog.org/syslog-ng/v2/ has some more examples.

Timo


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100517211206.GA5127@spinnennetz.org">http://lists.debian.org/20100517211206.GA5127@spinnennetz.org
 

Thread Tools




All times are GMT. The time now is 11:36 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org