EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Suggestion for IOC log server
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 24 May 2011 17:21:44 -0500
Hi Lana,

On 2011-05-24 Abadie Lana wrote:
> I would like to make a change in the iocLogServer.c and in particular to
>  always force the close and open of the log file when the IOC log server
>  catches a SIGHUP. Currently it checks the file name is not the same one to
>  perform the action :
>
> if (strcmp(ioc_log_file_name, pserver->outfile) == 0)
>
> Why is this a problem?
> We are using logrotate in our system.

The log server has its own version of logfile rotation, which was added in 
1996 by KECK (does KECK still use that feature — Kevin?).  I don't claim to 
understand it completely, but the the current behavior is that when it gets a 
SIGHUP it will execute the command given in the environment variable 
EPICS_IOC_LOG_FILE_COMMAND to get the name of the new logfile.  That might be 
something like this, which (in conjunction with a daily cron job run at 
midnight) would create a new log file in a dated directory:

date -u +/path/to/iocLog/%Y-%m-%d

If you want the latest log file to always be accessible at the same filename, 
you could arrange for the script that sends the SIGHUP to also create a soft-
link pointing to the new log file.

I don't see a particularly compelling reason to reject the change you're 
asking for though, does anyone else object?  The only downside appears to be 
that the server code has to scan through the log-file looking for the write 
location if the name doesn't change, but I don't see that as a major problem 
myself.  Does anyone object to this?

Note that the circular nature of the ioc log-files means that standard Linux 
logging tools could get confused when they hit the end/beginning point in the 
file, so this might not solve all of the problems with the log server.

You could also create your own simpler version of the log server that is 
compatible with logrotate and doesn't implement the circular behavior.  I also 
think maybe we should replace our own IOC logging system with one that is 
compatible with the modern remote logging packages that are now in fairly wide 
use.  Discussion and code contributions welcome...

- Andrew
-- 
Optimization is the process of taking something that works and
replacing it with something that almost works, but costs less.
-- Roger Needham


Replies:
RE: Suggestion for IOC log server Abadie Lana
References:
Device Support for Nemic Lambda Power Supplies Anthony Andrews
Re: Device Support for Nemic Lambda Power Supplies Eric Norum
Suggestion for IOC log server Abadie Lana

Navigate by Date:
Prev: RE: Windows XP Cygwin difficulties for building EPICS base Cid, Florencio A
Next: RE: Another gateway question Jeff Hill
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Suggestion for IOC log server J. Lewis Muir
Next: RE: Suggestion for IOC log server Abadie Lana
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·