tacho / conman

Automatically exported from code.google.com/p/conman
GNU General Public License v3.0
1 stars 0 forks source link

Logging directive doesn't get expanded after initial start #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
For a log directive like:

  global log="%N/%Y-%m-%d.log"

the variables will be expanded when conman starts, and you'll get logs like:

  server1/2012-03-15.log

However, all log entries will be written to this file until the process is 
restarted. It would be nice if these variables could be expanded when log lines 
need to be written (or at least periodically) in order to permit automatic log 
file changes (e.g. to server1/2012-03-16.log the next day).

Original issue reported on code.google.com by si...@zombe.es on 21 Mar 2012 at 10:39

GoogleCodeExporter commented 9 years ago
conmand will re-evaluate conversion specifiers within filenames and re-open log 
files if it receives a SIGHUP.

Original comment by chris.m.dunlap on 21 Mar 2012 at 10:47

GoogleCodeExporter commented 9 years ago
BTW, this has been the behavior since 0.1.8.5.

Did you have something else in mind?

Original comment by chris.m.dunlap on 21 Mar 2012 at 11:05

GoogleCodeExporter commented 9 years ago
Yeah, I was hoping it would function more like automatically rolling the logs 
as the time changed, sort of how cronolog works for Apache.

I can achieve my desired behavior by HUPing conmand at midnight, which is fine. 
So maybe all that's needed is a note in the docs that the variables are only 
expanded at start and when the config is reloaded in order to manage user 
expectations?

Original comment by si...@zombe.es on 21 Mar 2012 at 11:26

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r1077.

Conversion specifiers within console log filenames are evaluated
when the file is opened; this occurs when conmand first starts and
whenever it receives a SIGHUP.

Original comment by chris.m.dunlap on 27 Mar 2012 at 9:51