[syslog-ng] Log Rotation

Geller, Sandor (IT) Sandor.Geller at morganstanley.com
Thu Sep 6 12:09:33 CEST 2007


Hello,

> I am logging locally to
> 
> destination hosts { 
> file("/opt/log/HOSTS/$YEAR/$MONTH/$DAY/$HOST/$PROGRAM" 
> owner(root) group(root) perm(0600) dir_perm(0700) create_dirs(yes));};

Why do you want to rotate these??? New files will be created every
day. Simply delete the old ones if you need to reclaim space.

> I am also logging to a mysql database
> 
> destination d_mysql { pipe("/tmp/mysql.pipe" template("INSERT 
> INTO logs (host, facility, priority, level, tag, date, time, 
> program, msg) VALUES ('$HOST', '$FACILITY', '$PRIORITY', 
> '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', 
> '$PROGRAM', '$MSG');\n") template-escape(yes)); };

Sorry, I still don't understand what do you want to achieve.

Log rotation or log retention ?

regards,

Sandor
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.


More information about the syslog-ng mailing list