core: Make sure configured logfile always trumps default one

Previously we could end up logging to the default location if we
had deprecated variables defined before we defined log_file (which
caused us to write to the log_file set as default at compile time),
but the logging api is clever enough to keep that file open and
won't reopen it unnecessarily.

With this patch, we always close the log_file whenever we run into
the log_file statement, which causes the logging api to reopen it
with the new (and correct) path whenever we want to log something
again.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2698 5f96b256-904b-4d8d-8c98-d829582c6739
core: Log deprecated variables to the 'final' logfile

The previous patch made sure we started writing "real" logmessages
to the right place, but could still cause some logmessages to end up
in the wrong logfile. With this change we protect against that by
adding deprecated variables to a list and printing their warnings
when we're done parsing the entire file (which means we've always
parsed the 'log_file' statement).

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2699 5f96b256-904b-4d8d-8c98-d829582c6739
core: Check timeperiods for circular exclusions

Doing the exclusion logic right means traversing all the exclusions.
If there are circular paths there we might be at it for ever, which
is bad. With this patch we know we don't need to bother checking it
in the timeperiod handling code, which is messy enough as it is.

Signed-off-by: Andreas Ericsson <ae@op5.se>

git-svn-id: https://nagios.svn.sourceforge.net/svnroot/nagios/nagioscore/trunk@2700 5f96b256-904b-4d8d-8c98-d829582c6739