> I'm looking for a __simple__ way to approach this. I would like to
> create a "log" type file from an application. Instead of logging to a
> specific file name each time, I would like to log to a "base name"
which
> then appends an ever increasing number on the end. This is like a GDG
in
> z/OS, where I just specify DSN=SOME.NAME(+1) and the system generates
> the next GDG number in sequence. So far, the best that I've come up
with
> is something like:

There is a C function called tmpnam that will create a temporary file
name for you, but there isn't a concept of a GDG; you get a name
generated by the call which is seldom human predictable. 

A suggestion, though: Rather than invent your own logging, use syslog.
It's better integrated with management tools, and you don't have to
worry about the file storage at all, and your operators only have one
place to look for problems. 

For C or other compiled languages, #include syslog.h in your program,
and then use openlog/syslog/closelog to write messages. 

For scripts, you can use 'logger' in to do the same job. Creating the
log entry becomes something like:

logger -p local0.notice -t MYHOST: 'Application Foo Borked Itself.
Please check it.'

Much easier and much more system management friendly. 

-- db

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to