kcnainwal@gmail.com <kcnainwal@gmail.com> wrote:
> Yes, you're right. I know one needs to edit syslog.conf file in order
> to direct the log messages. I think you don't get my problem. Ok, here
> I try again.
> There are 2 problems with what you're suggesting-
>
> 1) I want the output in the /var/adm/streams/error.mm-dd file (which is
> the streams log file), and this is not a single file. It keeps changing
> with days. For each day (of each month) a new file get s created. So
> if I want a log today, it would be in the file
> "/var/adm/streams/error.11-29", and if I want it tomorrow, then it
> should be in "/var/adm/streams/error.11-30". Now there is no way (as
> far as I know) we can specify this kind of requirement in syslog.conf
> file.
> 2) I'm creating this shell script for an end-user, whose machine might
> be configured with different logging options, and who probably don't
> want to change those settings. What I want is a one-shot solutions
> (without changing any of the existing system logging settings).
>
> I've done this inside the driver using strlog() routine. What I want is
> an equivalent from the command line.
I see.
That cannot be done with syslog, especially not without modifying the
configuration.
Since you are writing shell scripts, I'd suggest that you use something
else than logger to log messages.
What keeps you from using something like
echo "message to log" >>$logfile
in your shell script?
I am sure you thought of that, so please explain why you think that this
solution is inappropriate.
Is it because you want to write to a destination where the user may not
write? If that's the case, you will not get away without modifying
something on the user's machine.
Yours,
Laurenz Albe