Re: Put date on log file names?

2010-05-17 Thread Timo Boettcher
Hi!

* vr  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\n")
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-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100517211206.ga5...@spinnennetz.org



Re: Put date on log file names?

2010-05-17 Thread Chris Jackson

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-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Archive: http://lists.debian.org/4bf1874f.60...@shadowcat.co.uk



Re: Put date on log file names?

2010-05-17 Thread Camaleón
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
MMDD instead of simply adding a number.
***

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2010.05.17.18.40...@gmail.com